Skip to content

Commit e5872c5

Browse files
authored
chore: upgrade operator-sdk to 1.32 (#1447)
* chore: operator-sdk upgrade Signed-off-by: saumeya <[email protected]> --------- Signed-off-by: saumeya <[email protected]>
1 parent c9d2716 commit e5872c5

27 files changed

+15792
-15609
lines changed

.github/workflows/codegen.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ jobs:
4040
run: |
4141
make bundle
4242
- name: Ensure there is no diff in bundle
43+
# --ignore-matching-lines='.*createdAt:.*' added to ignore bundle differences of timestamp that is generated by upgraded operator-sdk
4344
run: |
44-
git diff --exit-code -- .
45+
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
4546
- name: Run make generate
4647
run: |
4748
make generate
4849
- name: Ensure there is no diff in generated assets
4950
run: |
50-
git diff --exit-code -- .
51+
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
5152
- name: Run make manifests
5253
run: |
5354
make manifests
5455
- name: Ensure there is no diff in manifests
5556
run: |
56-
git diff --exit-code -- .
57+
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .

Makefile

+10-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
3434

3535
# Set the Operator SDK version to use.
3636
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
37-
OPERATOR_SDK_VERSION ?= v1.11.0
37+
OPERATOR_SDK_VERSION ?= v1.32.0
3838

3939

4040
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
@@ -50,8 +50,6 @@ BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
5050

5151
# Image URL to use all building/pushing image targets
5252
IMG ?= $(IMAGE_TAG_BASE):v$(VERSION)
53-
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
54-
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
5553

5654
LD_FLAGS = "-X github.com/argoproj-labs/argocd-operator/version.Version=$(VERSION)"
5755

@@ -89,7 +87,7 @@ help: ## Display this help.
8987
##@ Development
9088

9189
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
92-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
90+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
9391

9492
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
9593
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
@@ -141,21 +139,25 @@ endif
141139

142140
##@ Deployment
143141

142+
ifndef ignore-not-found
143+
ignore-not-found = false
144+
endif
145+
144146
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
145147
## TODO: Remove sed usage after all v1alpha1 references are updated to v1beta1 in codebase.
146148
## For local testing, conversion webhook defined in crd makes call to webhook for each v1alpha1 reference
147149
## causing failures as we don't set up the webhook for local testing.
148150
$(KUSTOMIZE) build config/crd | sed '/conversion:/,/- v1beta1/d' |kubectl apply --server-side=true -f -
149151

150152
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
151-
$(KUSTOMIZE) build config/crd | kubectl delete -f -
153+
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
152154

153155
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
154156
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
155157
$(KUSTOMIZE) build config/default | kubectl apply --server-side=true -f -
156158

157159
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
158-
$(KUSTOMIZE) build config/default | kubectl delete -f -
160+
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
159161

160162
##@ E2E
161163

@@ -166,7 +168,7 @@ all: test install run e2e ## UnitTest, Run the operator locally and execute e2e
166168

167169
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
168170
controller-gen: ## Download controller-gen locally if necessary.
169-
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1)
171+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)
170172

171173
KUSTOMIZE = $(shell pwd)/bin/kustomize
172174
kustomize: ## Download kustomize locally if necessary.
@@ -248,7 +250,7 @@ ifeq (,$(shell which opm 2>/dev/null))
248250
set -e ;\
249251
mkdir -p $(dir $(OPM)) ;\
250252
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
251-
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.20.0/$${OS}-$${ARCH}-opm ;\
253+
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\
252254
chmod +x $(OPM) ;\
253255
}
254256
else

api/v1alpha1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=argocd-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
9-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git
9+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.32.0
1010
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1111
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1212

bundle/manifests/argocd-operator.clusterserviceversion.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ metadata:
247247
capabilities: Deep Insights
248248
categories: Integration & Delivery
249249
certified: "false"
250+
createdAt: "2024-07-10T07:02:10Z"
250251
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
251-
operators.operatorframework.io/builder: operator-sdk-v1.10.0+git
252+
operators.operatorframework.io/builder: operator-sdk-v1.32.0
252253
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
253254
repository: https://github.com/argoproj-labs/argocd-operator
254255
support: Argo CD
@@ -666,8 +667,8 @@ spec:
666667
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:RBAC
667668
- urn:alm:descriptor:com.tectonic.ui:text
668669
- description: 'Policy is CSV containing user-defined RBAC policies and role
669-
definitions. Policy rules are in the form: p, subject, resource, action,
670-
object, effect Role definitions and bindings are in the form: g, subject,
670+
definitions. Policy rules are in the form: p, subject, resource, action,
671+
object, effect Role definitions and bindings are in the form: g, subject,
671672
inherited-subject See https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/rbac.md
672673
for additional information.'
673674
displayName: Policy
@@ -1244,8 +1245,8 @@ spec:
12441245
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:RBAC
12451246
- urn:alm:descriptor:com.tectonic.ui:text
12461247
- description: 'Policy is CSV containing user-defined RBAC policies and role
1247-
definitions. Policy rules are in the form: p, subject, resource, action,
1248-
object, effect Role definitions and bindings are in the form: g, subject,
1248+
definitions. Policy rules are in the form: p, subject, resource, action,
1249+
object, effect Role definitions and bindings are in the form: g, subject,
12491250
inherited-subject See https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/rbac.md
12501251
for additional information.'
12511252
displayName: Policy
@@ -1865,7 +1866,9 @@ spec:
18651866
- create
18661867
serviceAccountName: argocd-operator-controller-manager
18671868
deployments:
1868-
- name: argocd-operator-controller-manager
1869+
- label:
1870+
control-plane: argocd-operator
1871+
name: argocd-operator-controller-manager
18691872
spec:
18701873
replicas: 1
18711874
selector:
@@ -1874,6 +1877,8 @@ spec:
18741877
strategy: {}
18751878
template:
18761879
metadata:
1880+
annotations:
1881+
kubectl.kubernetes.io/default-container: manager
18771882
labels:
18781883
control-plane: argocd-operator
18791884
spec:

0 commit comments

Comments
 (0)