Skip to content

Commit

Permalink
chore: upgrade operator-sdk to 1.32 (#1447)
Browse files Browse the repository at this point in the history
* chore: operator-sdk upgrade

Signed-off-by: saumeya <[email protected]>

---------

Signed-off-by: saumeya <[email protected]>
  • Loading branch information
saumeya authored Jul 10, 2024
1 parent c9d2716 commit e5872c5
Show file tree
Hide file tree
Showing 27 changed files with 15,792 additions and 15,609 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ jobs:
run: |
make bundle
- name: Ensure there is no diff in bundle
# --ignore-matching-lines='.*createdAt:.*' added to ignore bundle differences of timestamp that is generated by upgraded operator-sdk
run: |
git diff --exit-code -- .
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
- name: Run make generate
run: |
make generate
- name: Ensure there is no diff in generated assets
run: |
git diff --exit-code -- .
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
- name: Run make manifests
run: |
make manifests
- name: Ensure there is no diff in manifests
run: |
git diff --exit-code -- .
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code -- .
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

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


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

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

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

Expand Down Expand Up @@ -89,7 +87,7 @@ help: ## Display this help.
##@ Development

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

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

##@ Deployment

ifndef ignore-not-found
ignore-not-found = false
endif

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

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

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

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

##@ E2E

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

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

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
Expand Down Expand Up @@ -248,7 +250,7 @@ ifeq (,$(shell which opm 2>/dev/null))
set -e ;\
mkdir -p $(dir $(OPM)) ;\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.20.0/$${OS}-$${ARCH}-opm ;\
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\
chmod +x $(OPM) ;\
}
else
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=argocd-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.10.0+git
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.32.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
17 changes: 11 additions & 6 deletions bundle/manifests/argocd-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ metadata:
capabilities: Deep Insights
categories: Integration & Delivery
certified: "false"
createdAt: "2024-07-10T07:02:10Z"
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
operators.operatorframework.io/builder: operator-sdk-v1.10.0+git
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/argoproj-labs/argocd-operator
support: Argo CD
Expand Down Expand Up @@ -666,8 +667,8 @@ spec:
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:RBAC
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Policy is CSV containing user-defined RBAC policies and role
definitions. Policy rules are in the form: p, subject, resource, action,
object, effect Role definitions and bindings are in the form: g, subject,
definitions. Policy rules are in the form: p, subject, resource, action,
object, effect Role definitions and bindings are in the form: g, subject,
inherited-subject See https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/rbac.md
for additional information.'
displayName: Policy
Expand Down Expand Up @@ -1244,8 +1245,8 @@ spec:
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:RBAC
- urn:alm:descriptor:com.tectonic.ui:text
- description: 'Policy is CSV containing user-defined RBAC policies and role
definitions. Policy rules are in the form: p, subject, resource, action,
object, effect Role definitions and bindings are in the form: g, subject,
definitions. Policy rules are in the form: p, subject, resource, action,
object, effect Role definitions and bindings are in the form: g, subject,
inherited-subject See https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/rbac.md
for additional information.'
displayName: Policy
Expand Down Expand Up @@ -1865,7 +1866,9 @@ spec:
- create
serviceAccountName: argocd-operator-controller-manager
deployments:
- name: argocd-operator-controller-manager
- label:
control-plane: argocd-operator
name: argocd-operator-controller-manager
spec:
replicas: 1
selector:
Expand All @@ -1874,6 +1877,8 @@ spec:
strategy: {}
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: argocd-operator
spec:
Expand Down
Loading

0 comments on commit e5872c5

Please sign in to comment.