mirror of
https://gerrit.hackerspace.pl/hscloud
synced 2025-01-24 15:13:53 +00:00
radex
52ab741686
Change-Id: I3f4cce02eb6bb34c2fd66062b122464daeaae7bb Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/2120 Reviewed-by: pl <pl@hackerspace.pl> Reviewed-by: q3k <q3k@hackerspace.pl>
71 lines
1.8 KiB
Python
71 lines
1.8 KiB
Python
load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_binary")
|
|
load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
|
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
|
|
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
|
|
|
|
go_library(
|
|
name = "admitomatic_lib",
|
|
srcs = [
|
|
"ingress.go",
|
|
"main.go",
|
|
"service.go",
|
|
],
|
|
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic",
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
"//cluster/admitomatic/config",
|
|
"//go/mirko",
|
|
"@com_github_golang_glog//:glog",
|
|
"@io_k8s_api//admission/v1beta1",
|
|
"@io_k8s_api//networking/v1beta1",
|
|
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
|
"@org_golang_google_protobuf//encoding/prototext",
|
|
],
|
|
)
|
|
|
|
go_binary(
|
|
name = "admitomatic",
|
|
embed = [":admitomatic_lib"],
|
|
pure = "on",
|
|
static = "on",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
platform_transition_binary(
|
|
name = "admitomatic_x86",
|
|
binary = ":admitomatic",
|
|
target_platform = "@rules_go//go/toolchain:linux_amd64",
|
|
)
|
|
|
|
go_test(
|
|
name = "admitomatic_test",
|
|
srcs = ["ingress_test.go"],
|
|
embed = [":admitomatic_lib"],
|
|
deps = [
|
|
"@io_k8s_api//admission/v1beta1",
|
|
"@io_k8s_api//networking/v1beta1",
|
|
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
|
|
"@io_k8s_apimachinery//pkg/runtime",
|
|
],
|
|
)
|
|
|
|
pkg_tar(
|
|
name = "layer_bin",
|
|
srcs = [":admitomatic_x86"],
|
|
package_dir = "/cluster/admitomatic/",
|
|
)
|
|
|
|
oci_image(
|
|
name = "runtime",
|
|
base = "@prodimage-noble-oci",
|
|
tars = [
|
|
":layer_bin",
|
|
],
|
|
)
|
|
|
|
oci_push(
|
|
name = "push",
|
|
image = ":runtime",
|
|
remote_tags = ["20250112172554"],
|
|
repository = "registry.k0.hswaw.net/radex/admitomatic",
|
|
)
|