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

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

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "github.com/jetstack/cert-manager/cmd/webhook",
    visibility = ["//visibility:private"],
    deps = [
        "//pkg/apis/certmanager/v1alpha1:go_default_library",
        "//pkg/logs:go_default_library",
        "//pkg/webhook:go_default_library",
        "//pkg/webhook/handlers:go_default_library",
        "//vendor/github.com/openshift/generic-admission-server/pkg/cmd:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
        "//vendor/k8s.io/klog:go_default_library",
    ],
)

go_binary(
    name = "webhook",
    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"],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
