Skip to content

Commit

Permalink
feat: Update non-olm-install script to setup conversion webhook (#603)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
svghadi committed Sep 25, 2023
1 parent 14a6866 commit b10480b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions hack/non-olm-install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion hack/non-olm-install/install-gitops-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..";
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -398,6 +399,7 @@ function delete_kustomize_manifests() {
retry_count=$((retry_count+1))
${KUSTOMIZE} build ${WORK_DIR} > ${WORK_DIR}/kustomize-build-output.yaml && break
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
}
Expand Down

0 comments on commit b10480b

Please sign in to comment.