load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "go_default_library",
    srcs = [
        "informers.go",
        "listers.go",
        "util.go",
    ],
    importpath = "github.com/jetstack/cert-manager/pkg/controller/certificates",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/apis/certmanager/v1:go_default_library",
        "//pkg/client/listers/certmanager/v1:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/logs:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/util/pki:go_default_library",
        "//pkg/util/predicate:go_default_library",
        "@com_github_go_logr_logr//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/labels:go_default_library",
        "@io_k8s_apimachinery//pkg/runtime:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_client_go//listers/core/v1:go_default_library",
        "@io_k8s_client_go//util/workqueue:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//pkg/controller/certificates/internal/secretsmanager:all-srcs",
        "//pkg/controller/certificates/internal/test:all-srcs",
        "//pkg/controller/certificates/issuing:all-srcs",
        "//pkg/controller/certificates/keymanager:all-srcs",
        "//pkg/controller/certificates/metrics:all-srcs",
        "//pkg/controller/certificates/readiness:all-srcs",
        "//pkg/controller/certificates/requestmanager:all-srcs",
        "//pkg/controller/certificates/trigger:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "go_default_test",
    srcs = ["util_test.go"],
    embed = [":go_default_library"],
    deps = [
        "//pkg/apis/certmanager/v1:go_default_library",
        "//pkg/util/pki:go_default_library",
        "@com_github_stretchr_testify//assert:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
    ],
)
