feat(k8s): upgrade to kubebuilder v4

This commit is contained in:
Daniel Hougaard
2025-08-08 05:07:43 +04:00
parent 6100086338
commit 847c50d2d4
25 changed files with 459 additions and 534 deletions

View File

@@ -31,16 +31,16 @@ import (
)
// namespace where the project is deployed in
const namespace = "k8-operator-system"
const namespace = "infisical-operator-system"
// serviceAccountName created for the project
const serviceAccountName = "k8-operator-controller-manager"
const serviceAccountName = "infisical-operator-controller-manager"
// metricsServiceName is the name of the metrics service of the project
const metricsServiceName = "k8-operator-controller-manager-metrics-service"
const metricsServiceName = "infisical-operator-controller-manager-metrics-service"
// metricsRoleBindingName is the name of the RBAC that will be created to allow get the metrics data
const metricsRoleBindingName = "k8-operator-metrics-binding"
const metricsRoleBindingName = "infisical-operator-metrics-binding"
var _ = Describe("Manager", Ordered, func() {
var controllerPodName string
@@ -173,7 +173,7 @@ var _ = Describe("Manager", Ordered, func() {
It("should ensure the metrics endpoint is serving metrics", func() {
By("creating a ClusterRoleBinding for the service account to allow access to metrics")
cmd := exec.Command("kubectl", "create", "clusterrolebinding", metricsRoleBindingName,
"--clusterrole=k8-operator-metrics-reader",
"--clusterrole=infisical-operator-metrics-reader",
fmt.Sprintf("--serviceaccount=%s:%s", namespace, serviceAccountName),
)
_, err := utils.Run(cmd)