-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBUILD.bazel
94 lines (83 loc) · 2.97 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "k8s.io/kops/cmd/kops-controller",
visibility = ["//visibility:private"],
deps = [
"//cmd/kops-controller/controllers:go_default_library",
"//cmd/kops-controller/pkg/config:go_default_library",
"//cmd/kops-controller/pkg/server:go_default_library",
"//pkg/nodeidentity:go_default_library",
"//pkg/nodeidentity/aws:go_default_library",
"//pkg/nodeidentity/azure:go_default_library",
"//pkg/nodeidentity/do:go_default_library",
"//pkg/nodeidentity/gce:go_default_library",
"//pkg/nodeidentity/openstack:go_default_library",
"//upup/pkg/fi:go_default_library",
"//upup/pkg/fi/cloudup/awsup:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
"//vendor/k8s.io/klog/v2/klogr:go_default_library",
"//vendor/sigs.k8s.io/controller-runtime:go_default_library",
"//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library",
"//vendor/sigs.k8s.io/yaml:go_default_library",
],
)
go_binary(
name = "kops-controller",
out = select({
"@io_bazel_rules_go//go/platform:linux_amd64": "linux-amd64/kops-controller",
"@io_bazel_rules_go//go/platform:linux_arm64": "linux-arm64/kops-controller",
"@io_bazel_rules_go//go/platform:darwin_amd64": "darwin-amd64/kops-controller",
}),
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_bundle",
"container_image",
"container_push",
)
ARCH = [
"amd64",
"arm64",
]
[container_image(
name = "image-%s" % arch,
architecture = arch,
base = "@distroless_base_%s//image" % arch,
cmd = ["/kops-controller"],
files = [
"//cmd/kops-controller",
],
stamp = True,
user = "10011",
) for arch in ARCH]
[container_push(
name = "push-image-%s" % arch,
format = "Docker",
image = ":image-%s" % arch,
registry = "{STABLE_DOCKER_REGISTRY}",
repository = "{STABLE_DOCKER_IMAGE_PREFIX}kops-controller",
tag = "{STABLE_KOPS_CONTROLLER_TAG}-%s" % arch,
) for arch in ARCH]
[container_bundle(
name = "image-bundle-%s" % arch,
images = {
"{STABLE_DOCKER_IMAGE_PREFIX}kops-controller:{STABLE_KOPS_CONTROLLER_TAG}": "image-%s" % arch,
},
) for arch in ARCH]
load("//tools:gzip.bzl", "gzip")
[gzip(
name = "image-bundle-%s.tar.gz" % arch,
src = "image-bundle-%s.tar" % arch,
) for arch in ARCH]
load("//tools:hashes.bzl", "hashes")
[hashes(
name = "image-bundle-%s.tar.gz.hashes" % arch,
src = "image-bundle-%s.tar.gz" % arch,
) for arch in ARCH]