Skip to content

Commit b10480b

Browse files
authored
feat: Update non-olm-install script to setup conversion webhook (#603)
* Update non-olm-install script to setup conversion webhook Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * fix non-olm installation Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> * Move yq out of loop Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com> --------- Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
1 parent 14a6866 commit b10480b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

config/rbac/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resources:
1212
# Comment the following 4 lines if you want to disable
1313
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
1414
# which protects your /metrics endpoint.
15-
# - auth_proxy_service.yaml
15+
- auth_proxy_service.yaml
1616
- auth_proxy_role.yaml
1717
- auth_proxy_role_binding.yaml
1818
# - auth_proxy_client_clusterrole.yaml

hack/non-olm-install/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ The following environment variables can be set to configure various options for
8585
| **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 |
8686
| **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 |
8787
| **WATCH_NAMESPACE** | namespaces in which Argo applications can be created | None |
88+
| **ENABLE_CONVERSION_WEBHOOK** | This environment variable enables conversion webhook to convert v1alpha1 ArgoCD resources to v1beta1 | true |
8889
### Running the script
8990

9091
#### Usage

hack/non-olm-install/install-gitops-operator.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function rollback_to_previous_image() {
103103
if [ ! -z "${PREV_OPERATOR_IMG}" ]; then
104104
export OPERATOR_IMG=${PREV_OPERATOR_IMG}
105105
prepare_kustomize_files
106-
${KUSTOMIZE} build ${WORK_DIR} | ${KUBECTL} apply -f -
106+
${KUSTOMIZE} build ${WORK_DIR} | ${KUBECTL} apply --server-side=true -f -
107107
echo "[INFO] Operator update operation was unsuccessful!!";
108108
else
109109
echo "[INFO] Installing image for the first time. Nothing to rollback. Quitting..";
@@ -179,6 +179,7 @@ resources:
179179
- https://github.com/redhat-developer/gitops-operator/config/rbac?ref=$GIT_REVISION&timeout=90s
180180
- https://github.com/redhat-developer/gitops-operator/config/manager?ref=$GIT_REVISION&timeout=90s
181181
- https://github.com/redhat-developer/gitops-operator/config/prometheus?ref=$GIT_REVISION&timeout=90s
182+
- https://github.com/redhat-developer/gitops-operator/config/webhook?ref=$GIT_REVISION&timeout=90s
182183
patches:
183184
- path: https://raw.githubusercontent.com/redhat-developer/gitops-operator/master/config/default/manager_auth_proxy_patch.yaml
184185
- path: https://raw.githubusercontent.com/redhat-developer/gitops-operator/master/config/default/manager_webhook_patch.yaml
@@ -398,6 +399,7 @@ function delete_kustomize_manifests() {
398399
retry_count=$((retry_count+1))
399400
${KUSTOMIZE} build ${WORK_DIR} > ${WORK_DIR}/kustomize-build-output.yaml && break
400401
done
402+
${YQ} -i 'del( .metadata.creationTimestamp | select(. == "null") )' ${WORK_DIR}/kustomize-build-output.yaml
401403
echo "[INFO] Deleting k8s resources from kustomize manifests"
402404
${KUBECTL} delete -f ${WORK_DIR}/kustomize-build-output.yaml
403405
}

0 commit comments

Comments
 (0)