Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update non-olm-install script to setup conversion webhook #603

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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