Skip to content

Commit

Permalink
Add ArgoCD v1beta1 & deprecate v1alpha1 (#999)
Browse files Browse the repository at this point in the history
- Add new ArgoCD v1beta1 api
- Mark ArgoCD v1alpha1 as deprecated & add back the removed sso fields
- Use server side validation for "kubectl apply" as client side results into
  failure due to exceeding annotation size limit.
- Add funcs for ArgoCD alpha to beta conversion
- Create webhook & setup webhook server on 9443
- Disable operator namespaced install via OLM so that OLM can handle certs for webhook server
- For manual install, user needs to explicitly configure cert manager to inject certs and enable
  webhook server in operator by setting env ENABLE_CONVERSION_WEBHOOK="true"

Signed-off-by: Siddhesh Ghadi <[email protected]>
  • Loading branch information
svghadi authored Sep 19, 2023
1 parent b529e86 commit 4ceafa5
Show file tree
Hide file tree
Showing 54 changed files with 25,432 additions and 99 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ docker-push: ## Push docker image with the manager.
##@ Deployment

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
## 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 -

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 -f -
$(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 -
Expand All @@ -137,7 +140,7 @@ kustomize: ## Download kustomize locally if necessary.
ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
$(ENVTEST) use 1.21
$(ENVTEST) use 1.26

# go-install-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down Expand Up @@ -210,7 +213,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.15.1/$${OS}-$${ARCH}-opm ;\
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.20.0/$${OS}-$${ARCH}-opm ;\
chmod +x $(OPM) ;\
}
else
Expand Down
10 changes: 10 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ resources:
kind: ArgoCDExport
path: github.com/argoproj-labs/argocd-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
group: argoproj.io
kind: ArgoCD
path: github.com/argoproj-labs/argocd-operator/api/v1beta1
version: v1beta1
webhooks:
conversion: true
webhookVersion: v1
version: "3"
Loading

0 comments on commit 4ceafa5

Please sign in to comment.