From 46b74e6add516b8809d2a3c205a06cec2fec7950 Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi Date: Tue, 5 Sep 2023 18:09:49 +0530 Subject: [PATCH 1/3] Update non-olm-install script to setup conversion webhook Signed-off-by: Siddhesh Ghadi --- hack/non-olm-install/README.md | 1 + hack/non-olm-install/install-gitops-operator.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hack/non-olm-install/README.md b/hack/non-olm-install/README.md index a9b835c5d..b0e1447d9 100644 --- a/hack/non-olm-install/README.md +++ b/hack/non-olm-install/README.md @@ -85,6 +85,7 @@ The following environment variables can be set to configure various options for | **DISABLE_DEFAULT_ARGOCD_INSTANCE** | When set to `true`, this will disable the default 'ready-to-use' installation of Argo CD in the `openshift-gitops` namespace. |false | | **SERVER_CLUSTER_ROLE** |This environment variable enables administrators to configure a common cluster role to use across all of the managed namespaces in the role bindings the operator creates for the Argo CD server. | None | | **WATCH_NAMESPACE** | namespaces in which Argo applications can be created | None | +| **ENABLE_CONVERSION_WEBHOOK** | This environment variable enables conversion webhook to convert v1alpha1 ArgoCD resources to v1beta1 | true | ### Running the script #### Usage diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index 526a5e6c3..22e949791 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -103,7 +103,7 @@ function rollback_to_previous_image() { if [ ! -z "${PREV_OPERATOR_IMG}" ]; then export OPERATOR_IMG=${PREV_OPERATOR_IMG} prepare_kustomize_files - ${KUSTOMIZE} build ${WORK_DIR} | ${KUBECTL} apply -f - + ${KUSTOMIZE} build ${WORK_DIR} | ${KUBECTL} apply --server-side=true -f - echo "[INFO] Operator update operation was unsuccessful!!"; else echo "[INFO] Installing image for the first time. Nothing to rollback. Quitting.."; @@ -179,6 +179,7 @@ resources: - https://github.com/redhat-developer/gitops-operator/config/rbac?ref=$GIT_REVISION&timeout=90s - https://github.com/redhat-developer/gitops-operator/config/manager?ref=$GIT_REVISION&timeout=90s - https://github.com/redhat-developer/gitops-operator/config/prometheus?ref=$GIT_REVISION&timeout=90s + - https://github.com/redhat-developer/gitops-operator/config/webhook?ref=$GIT_REVISION&timeout=90s patches: - path: https://raw.githubusercontent.com/redhat-developer/gitops-operator/master/config/default/manager_auth_proxy_patch.yaml - path: https://raw.githubusercontent.com/redhat-developer/gitops-operator/master/config/default/manager_webhook_patch.yaml From 2fed35e582541b36d60dbb91c2c3ad3a6c42e374 Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi Date: Mon, 25 Sep 2023 15:33:45 +0530 Subject: [PATCH 2/3] fix non-olm installation Signed-off-by: Siddhesh Ghadi --- config/rbac/kustomization.yaml | 2 +- hack/non-olm-install/install-gitops-operator.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index d42f142e6..1798d0f8e 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -12,7 +12,7 @@ resources: # Comment the following 4 lines if you want to disable # the auth proxy (https://github.com/brancz/kube-rbac-proxy) # which protects your /metrics endpoint. -# - auth_proxy_service.yaml +- auth_proxy_service.yaml - auth_proxy_role.yaml - auth_proxy_role_binding.yaml # - auth_proxy_client_clusterrole.yaml diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index 22e949791..150d3e6c8 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -398,6 +398,7 @@ function delete_kustomize_manifests() { echo "[INFO] (Attempt ${retry_count}) Executing kustomize build command" retry_count=$((retry_count+1)) ${KUSTOMIZE} build ${WORK_DIR} > ${WORK_DIR}/kustomize-build-output.yaml && break + ${YQ} -i 'del( .metadata.creationTimestamp | select(. == "null") )' ${WORK_DIR}/kustomize-build-output.yaml done echo "[INFO] Deleting k8s resources from kustomize manifests" ${KUBECTL} delete -f ${WORK_DIR}/kustomize-build-output.yaml From e2152f48b7c8a4d1a08b8e784e3b1b189463f68a Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi Date: Mon, 25 Sep 2023 15:51:25 +0530 Subject: [PATCH 3/3] Move yq out of loop Signed-off-by: Siddhesh Ghadi --- hack/non-olm-install/install-gitops-operator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index 150d3e6c8..52d696508 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -398,8 +398,8 @@ function delete_kustomize_manifests() { echo "[INFO] (Attempt ${retry_count}) Executing kustomize build command" retry_count=$((retry_count+1)) ${KUSTOMIZE} build ${WORK_DIR} > ${WORK_DIR}/kustomize-build-output.yaml && break - ${YQ} -i 'del( .metadata.creationTimestamp | select(. == "null") )' ${WORK_DIR}/kustomize-build-output.yaml done + ${YQ} -i 'del( .metadata.creationTimestamp | select(. == "null") )' ${WORK_DIR}/kustomize-build-output.yaml echo "[INFO] Deleting k8s resources from kustomize manifests" ${KUBECTL} delete -f ${WORK_DIR}/kustomize-build-output.yaml }