load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//hack:def.bzl", "image")

image(
    name = "image",
    binary = ":controller",
    component = "controller",
    visibility = ["//visibility:public"],
)

go_library(
    name = "go_default_library",
    srcs = [
        "main.go",
        "start.go",
    ],
    importpath = "github.com/jetstack/cert-manager/cmd/controller",
    visibility = ["//visibility:private"],
    deps = [
        "//cmd/controller/app:go_default_library",
        "//cmd/controller/app/options:go_default_library",
        "//pkg/controller/acmechallenges:go_default_library",
        "//pkg/controller/acmeorders:go_default_library",
        "//pkg/controller/certificates:go_default_library",
        "//pkg/controller/clusterissuers:go_default_library",
        "//pkg/controller/ingress-shim:go_default_library",
        "//pkg/controller/issuers:go_default_library",
        "//pkg/issuer/acme:go_default_library",
        "//pkg/issuer/ca:go_default_library",
        "//pkg/issuer/selfsigned:go_default_library",
        "//pkg/issuer/vault:go_default_library",
        "//pkg/issuer/venafi:go_default_library",
        "//pkg/logs:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/util/feature:go_default_library",
        "//vendor/github.com/spf13/cobra:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
        "//vendor/k8s.io/client-go/plugin/pkg/client/auth:go_default_library",
        "//vendor/k8s.io/klog:go_default_library",
    ],
)

go_binary(
    name = "controller",
    embed = [":go_default_library"],
    pure = "on",
    visibility = ["//visibility:public"],
)

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

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//cmd/controller/app:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
