From f90c2396e5be08111356719b07275403a2b1dc08 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Mon, 5 Feb 2024 13:51:44 +0000 Subject: [PATCH 1/3] Add missing secret get/list rbac --- .../kuadrant-dns-operator.clusterserviceversion.yaml | 10 +++++++++- config/rbac/role.yaml | 8 ++++++++ internal/provider/factory.go | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml index 4f9c6367..4afcaa1d 100644 --- a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml @@ -69,7 +69,7 @@ metadata: } ] capabilities: Basic Install - createdAt: "2024-02-03T00:24:09Z" + createdAt: "2024-02-05T13:50:08Z" operators.operatorframework.io/builder: operator-sdk-v1.33.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 name: kuadrant-dns-operator.v0.0.1 @@ -103,6 +103,14 @@ spec: spec: clusterPermissions: - rules: + - apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch - apiGroups: - kuadrant.io resources: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index a33b8ae2..93144d85 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -4,6 +4,14 @@ kind: ClusterRole metadata: name: manager-role rules: +- apiGroups: + - "" + resources: + - secrets + verbs: + - get + - list + - watch - apiGroups: - kuadrant.io resources: diff --git a/internal/provider/factory.go b/internal/provider/factory.go index 2ba1c672..8a309634 100644 --- a/internal/provider/factory.go +++ b/internal/provider/factory.go @@ -12,6 +12,8 @@ import ( "github.com/kuadrant/kuadrant-dns-operator/api/v1alpha1" ) +// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch + var errUnsupportedProvider = fmt.Errorf("provider type given is not supported") // ProviderConstructor constructs a provider given a Secret resource and a Context. From 9634be61324eb427926d6bb04b538ea3ad5ba0bd Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Tue, 6 Feb 2024 14:18:33 +0000 Subject: [PATCH 2/3] Set VERSION to 0.0.0 --- Makefile | 2 +- .../kuadrant-dns-operator.clusterserviceversion.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cf7ba751..a32990fd 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 0.0.1 +VERSION ?= 0.0.0 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") diff --git a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml index 4afcaa1d..112ae627 100644 --- a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml @@ -69,10 +69,10 @@ metadata: } ] capabilities: Basic Install - createdAt: "2024-02-05T13:50:08Z" + createdAt: "2024-02-06T14:17:34Z" operators.operatorframework.io/builder: operator-sdk-v1.33.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 - name: kuadrant-dns-operator.v0.0.1 + name: kuadrant-dns-operator.v0.0.0 namespace: placeholder spec: apiservicedefinitions: {} @@ -344,4 +344,4 @@ spec: maturity: alpha provider: name: Red Hat - version: 0.0.1 + version: 0.0.0 From 2a3c7766e3f771428f9af65f3aa1f1fded549369 Mon Sep 17 00:00:00 2001 From: Michael Nairn Date: Thu, 8 Feb 2024 00:15:31 +0000 Subject: [PATCH 3/3] fix: manager control-plane name (kuadrant-dns-operator-controller-manager) update openshift imports to group all kuadrant repos fix verify-manifests typo in GH workflow --- .github/workflows/ci.yaml | 2 +- Makefile | 2 +- ...nt-dns-operator.clusterserviceversion.yaml | 8 ++-- config/manager/manager.yaml | 37 ++----------------- 4 files changed, 10 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 88588d5f..dd070ef5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,7 +94,7 @@ jobs: id: go - name: Check out code uses: actions/checkout@v4 - - name: Run make verify-manifests + - name: Run make verify-imports run: | make verify-imports unit_test_suite: diff --git a/Makefile b/Makefile index a32990fd..ec971692 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,7 @@ lint: ## Run golangci-lint against code. .PHONY: imports imports: openshift-goimports ## Run openshift goimports against code. - $(OPENSHIFT_GOIMPORTS) -m github.com/kuadrant/kuadrant-dns-operator -i github.com/kuadrant/kuadrant-operator + $(OPENSHIFT_GOIMPORTS) -m github.com/kuadrant/kuadrant-dns-operator -i github.com/kuadrant .PHONY: test test: test-unit test-integration ## Run tests. diff --git a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml index 112ae627..9a54bf66 100644 --- a/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-dns-operator.clusterserviceversion.yaml @@ -69,7 +69,7 @@ metadata: } ] capabilities: Basic Install - createdAt: "2024-02-06T14:17:34Z" + createdAt: "2024-02-08T09:42:33Z" operators.operatorframework.io/builder: operator-sdk-v1.33.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 name: kuadrant-dns-operator.v0.0.0 @@ -212,20 +212,20 @@ spec: app.kubernetes.io/managed-by: kustomize app.kubernetes.io/name: deployment app.kubernetes.io/part-of: kuadrant-dns-operator - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager name: kuadrant-dns-operator-controller-manager spec: replicas: 1 selector: matchLabels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager strategy: {} template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager spec: containers: - args: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 7e535328..e564e343 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager app.kubernetes.io/name: namespace app.kubernetes.io/instance: system app.kubernetes.io/component: manager @@ -17,7 +17,7 @@ metadata: name: controller-manager namespace: system labels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager app.kubernetes.io/name: deployment app.kubernetes.io/instance: controller-manager app.kubernetes.io/component: manager @@ -27,44 +27,17 @@ metadata: spec: selector: matchLabels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager replicas: 1 template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - control-plane: controller-manager + control-plane: kuadrant-dns-operator-controller-manager spec: - # TODO(user): Uncomment the following code to configure the nodeAffinity expression - # according to the platforms which are supported by your solution. - # It is considered best practice to support multiple architectures. You can - # build your manager image using the makefile target docker-buildx. - # affinity: - # nodeAffinity: - # requiredDuringSchedulingIgnoredDuringExecution: - # nodeSelectorTerms: - # - matchExpressions: - # - key: kubernetes.io/arch - # operator: In - # values: - # - amd64 - # - arm64 - # - ppc64le - # - s390x - # - key: kubernetes.io/os - # operator: In - # values: - # - linux securityContext: runAsNonRoot: true - # TODO(user): For common cases that do not require escalating privileges - # it is recommended to ensure that all your Pods/Containers are restrictive. - # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted - # Please uncomment the following code if your project does NOT have to work on old Kubernetes - # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ). - # seccompProfile: - # type: RuntimeDefault containers: - command: - /manager @@ -89,8 +62,6 @@ spec: port: 8081 initialDelaySeconds: 5 periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ resources: limits: cpu: 500m