diff --git a/README.md b/README.md index aafbe32b4..245eabc9c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ spec: ![a relative link](docs/assets/operatorhub-listing.png) -3. Install the operator using the defaults in the wizard, and wait for it to show up in the list of "Installed Operators". If it doesn't install properly, you can check on its status in the "Installed Operators" tab in the `openshift-operators` namespace. +3. Install the operator in the `openshift-gitops-operator` namesapce using the defaults in the wizard, and optionally, select the checkbox to enable cluster monitoring on the namesapce. Wait for it to show up in the list of "Installed Operators". If it doesn't install properly, you can check on its status in the "Installed Operators" tab in the `openshift-gitops-operator` namespace. ![a relative link](docs/assets/installed-operator.png) diff --git a/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml b/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml deleted file mode 100644 index d0dace51d..000000000 --- a/bundle/manifests/gitops-operator-controller-manager-metrics-service_v1_service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - control-plane: argocd-operator - name: gitops-operator-controller-manager-metrics-service -spec: - ports: - - name: https - port: 8443 - targetPort: https - selector: - control-plane: argocd-operator -status: - loadBalancer: {} diff --git a/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml deleted file mode 100644 index 2361e63f6..000000000 --- a/bundle/manifests/gitops-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: gitops-operator-metrics-reader -rules: -- nonResourceURLs: - - /metrics - verbs: - - get diff --git a/bundle/manifests/gitops-operator.clusterserviceversion.yaml b/bundle/manifests/gitops-operator.clusterserviceversion.yaml index c66c0fb51..f3baa2c72 100644 --- a/bundle/manifests/gitops-operator.clusterserviceversion.yaml +++ b/bundle/manifests/gitops-operator.clusterserviceversion.yaml @@ -137,6 +137,8 @@ metadata: containerImage: quay.io/redhat-developer/gitops-operator description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. + operatorframework.io/cluster-monitoring: "true" + operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' operators.operatorframework.io/builder: operator-sdk-v1.10.0+git operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 @@ -865,19 +867,19 @@ spec: - subjectaccessreviews verbs: - create - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager deployments: - - name: gitops-operator-controller-manager + - name: openshift-gitops-operator-controller-manager spec: replicas: 1 selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator strategy: {} template: metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: containers: - command: @@ -911,7 +913,7 @@ spec: runAsNonRoot: true securityContext: runAsNonRoot: true - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager terminationGracePeriodSeconds: 10 permissions: - rules: @@ -946,7 +948,7 @@ spec: verbs: - create - patch - serviceAccountName: gitops-operator-controller-manager + serviceAccountName: openshift-gitops-operator-controller-manager strategy: deployment installModes: - supported: false diff --git a/bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml b/bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml similarity index 88% rename from bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml rename to bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml index 47ad1ca82..dfef9c4bc 100644 --- a/bundle/manifests/gitops-operator-manager-config_v1_configmap.yaml +++ b/bundle/manifests/openshift-gitops-operator-manager-config_v1_configmap.yaml @@ -14,4 +14,4 @@ data: resourceName: 2b63967d.openshift.io kind: ConfigMap metadata: - name: gitops-operator-manager-config + name: openshift-gitops-operator-manager-config diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index de18dcfca..affdd9b8e 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: gitops-operator-system +namespace: openshift-gitops-operator # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: gitops-operator- +namePrefix: openshift-gitops-operator- # Labels to add to all resources and selectors. #commonLabels: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 49b525c07..092f91709 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: system --- apiVersion: apps/v1 @@ -11,16 +11,16 @@ metadata: name: controller-manager namespace: system labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator replicas: 1 template: metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator spec: securityContext: runAsNonRoot: true diff --git a/config/manifests/bases/gitops-operator.clusterserviceversion.yaml b/config/manifests/bases/gitops-operator.clusterserviceversion.yaml index f8cb67c63..774fc8875 100644 --- a/config/manifests/bases/gitops-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/gitops-operator.clusterserviceversion.yaml @@ -7,6 +7,8 @@ metadata: containerImage: quay.io/redhat-developer/gitops-operator description: Enables teams to adopt GitOps principles for managing cluster configurations and application delivery across hybrid multi-cluster Kubernetes environments. + operatorframework.io/cluster-monitoring: "true" + operatorframework.io/suggested-namespace: openshift-gitops-operator operators.openshift.io/infrastructure-features: '["disconnected"]' repository: https://github.com/redhat-developer/gitops-operator support: Red Hat diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index dd2aaaed6..c9eee0d77 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: controller-manager-metrics-monitor namespace: system spec: @@ -17,4 +17,4 @@ spec: insecureSkipVerify: true selector: matchLabels: - control-plane: argocd-operator + control-plane: gitops-operator diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index 7e3675472..5bd6a607d 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: labels: - control-plane: argocd-operator + control-plane: gitops-operator name: controller-manager-metrics-service namespace: system spec: @@ -11,4 +11,4 @@ spec: port: 8443 targetPort: https selector: - control-plane: argocd-operator + control-plane: gitops-operator diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 731832a6a..d42f142e6 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 +# - auth_proxy_client_clusterrole.yaml diff --git a/docs/OpenShift GitOps Usage Guide.md b/docs/OpenShift GitOps Usage Guide.md index 6c2304a82..725f4dc75 100644 --- a/docs/OpenShift GitOps Usage Guide.md +++ b/docs/OpenShift GitOps Usage Guide.md @@ -47,7 +47,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-gitops-operator - namespace: openshift-operators + namespace: openshift-gitops-operator spec: channel: stable installPlanApproval: Automatic diff --git a/hack/non-olm-install/install-gitops-operator.sh b/hack/non-olm-install/install-gitops-operator.sh index aa2543c22..c86a8e742 100755 --- a/hack/non-olm-install/install-gitops-operator.sh +++ b/hack/non-olm-install/install-gitops-operator.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash -NAMESPACE_PREFIX=${NAMESPACE_PREFIX:-"gitops-operator-"} +NAMESPACE=${NAMESPACE:-"openshift-gitops-operator"} +NAME_PREFIX=${NAME_PREFIX:-"openshift-gitops-operator-"} GIT_REVISION=${GIT_REVISION:-"master"} MAX_RETRIES=3 @@ -61,7 +62,7 @@ function print_help() { function check_pod_status_ready() { # Wait for the deployment rollout to complete before trying to list the pods # to ensure that only pods corresponding to the new version is considered. - ${KUBECTL} rollout status deploy -n ${NAMESPACE_PREFIX}system --timeout=5m + ${KUBECTL} rollout status deploy -n openshift-gitops-operator --timeout=5m if [ $? -ne 0 ]; then echo "[INFO] Deployments did not reach healthy state within 5m. Rolling back" else @@ -69,16 +70,16 @@ function check_pod_status_ready() { return 0 fi - pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n ${NAMESPACE_PREFIX}system | grep "${1}"); + pod_name=$(${KUBECTL} get pods --no-headers --field-selector="status.phase!=Succeeded" -o custom-columns=":metadata.name" -n openshift-gitops-operator | grep "${1}"); if [ -z "$pod_name" ]; then echo "[WARN] Ignoring empty pod name" return 0 fi echo "[DEBUG] Pod name : $pod_name"; - ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE_PREFIX}system --timeout=150s; + ${KUBECTL} wait pod --for=condition=Ready $pod_name -n ${NAMESPACE} --timeout=150s; if [ $? -ne 0 ]; then echo "[INFO] Pod '$pod_name' failed to become Ready in desired time. Logs from the pod:" - ${KUBECTL} logs $pod_name -n ${NAMESPACE_PREFIX}system --all-containers; + ${KUBECTL} logs $pod_name -n ${NAMESPACE} --all-containers; echo "[ERROR] Install/Upgrade failed. Performing rollback"; rollback return 1 @@ -170,8 +171,8 @@ function create_kustomization_init_file() { echo "[INFO] Creating kustomization.yaml file using manifests from revision '${GIT_REVISION}'" echo "apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: ${NAMESPACE_PREFIX}system -namePrefix: ${NAMESPACE_PREFIX} +namespace: ${NAMESPACE} +namePrefix: ${NAME_PREFIX} resources: - https://github.com/redhat-developer/gitops-operator/config/crd?ref=$GIT_REVISION&timeout=90s - https://github.com/redhat-developer/gitops-operator/config/rbac?ref=$GIT_REVISION&timeout=90s @@ -344,7 +345,7 @@ function check_prerequisite() { # if so, stores the previous version which would be used for rollback in case of # a failure during installation. function get_prev_operator_image() { - for image in $(${KUBECTL} get deploy/gitops-operator-controller-manager -n ${NAMESPACE_PREFIX}system -o jsonpath='{..image}' 2>/dev/null) + for image in $(${KUBECTL} get deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} -o jsonpath='{..image}' 2>/dev/null) do if [[ "${image}" == *"operator"* ]]; then PREV_OPERATOR_IMG="${image}" @@ -454,7 +455,7 @@ function migrate_olm_installation() { fi apply_kustomize_manifests # Check pod status if it becomes ready - check_pod_status_ready gitops-operator-controller-manager + check_pod_status_ready openshift-gitops-operator-controller-manager if [ $? -eq 0 ]; then # Non OLM installation is successful and its safe to remove the OLM specific @@ -468,20 +469,20 @@ function migrate_olm_installation() { # When migrating from OLM to non OLM installation, deployment created by the OLM operator # must be scaled down to avoid 2 conflicting operators operating on the same CR. function scale_down_olm_deploy() { - ${KUBECTL} scale deploy/gitops-operator-controller-manager -n openshift-operators --replicas=0 + ${KUBECTL} scale deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --replicas=0 } # If migration to non OLM installation fails, revert to OLM based installation # by scaling back the OLM created deployments from 0 to 1. # Note: Rollback is possible only if the corresponding Subscription and ClusterServiceVersion objects are available. function rollback_to_olm() { - ${KUBECTL} scale deploy/gitops-operator-controller-manager -n openshift-operators --replicas=1 + ${KUBECTL} scale deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --replicas=1 } # Deletes the subscription for openshift-gitops-operator function remove_subscription() { #Delete the gitops subscription - ${KUBECTL} delete subscription openshift-gitops-operator -n openshift-operators + ${KUBECTL} delete subscription openshift-gitops-operator -n ${NAMESPACE} } # Deletes the ClusterServiceVersion Object from the system @@ -492,13 +493,13 @@ function remove_installed_csv() { echo "[INFO] No installed CSV in Subscription" return fi - ${KUBECTL} delete clusterserviceversion ${installedCSV} -n openshift-operators + ${KUBECTL} delete clusterserviceversion ${installedCSV} -n ${NAMESPACE} } # Waits till the OLM removal is successful. function wait_for_olm_removal() { # Wait till the operator deployment is completely removed. - ${KUBECTL} wait --for=delete deploy/gitops-operator-controller-manager -n openshift-operators --timeout=60s + ${KUBECTL} wait --for=delete deploy/openshift-gitops-operator-controller-manager -n ${NAMESPACE} --timeout=60s } # Extract the custom configuration set in the Subscription and @@ -506,7 +507,7 @@ function wait_for_olm_removal() { # the non-OLM installation. function extract_custom_env_in_subscription() { # Get the GitOps subscription object as yaml - ${KUBECTL} get subscription openshift-gitops-operator -n openshift-operators -o yaml > ${WORK_DIR}/subscription.yaml + ${KUBECTL} get subscription openshift-gitops-operator -n ${NAMESPACE} -o yaml > ${WORK_DIR}/subscription.yaml # check if config.env element is present element=$(${YQ} '.spec.config.env' ${WORK_DIR}/subscription.yaml) if [ "${element}" == "null" ]; then @@ -547,9 +548,13 @@ function main() { prepare_kustomize_files print_info echo "[INFO] Performing $MODE operation for openshift-gitops-operator..." + if [[ $MODE == "Install" ]]; then + ${KUBECTL} create ns ${NAMESPACE} + ${KUBECTL} label ns ${NAMESPACE} openshift.io/cluster-monitoring=true + fi apply_kustomize_manifests # Check pod status and rollback if necessary. - check_pod_status_ready gitops-operator-controller-manager + check_pod_status_ready openshift-gitops-operator-controller-manager exit 0 ;; --uninstall | -u) @@ -562,6 +567,7 @@ function main() { # Remove the GitOpsService instance created for the default # ArgoCD instance created in openshift-gitops namespace. ${KUBECTL} delete gitopsservice/cluster + ${KUBECTL} delete ns ${NAMESPACE} delete_kustomize_manifests exit 0 ;; diff --git a/hack/scripts/run-non-olm-kuttl-test.sh b/hack/scripts/run-non-olm-kuttl-test.sh index 8b5f9250a..3eefb53ed 100755 --- a/hack/scripts/run-non-olm-kuttl-test.sh +++ b/hack/scripts/run-non-olm-kuttl-test.sh @@ -55,11 +55,11 @@ done #replace the namespace for assert in test file if [ -d "$temp_dir/sequential/1-018_validate_disable_default_instance" ]; then - sed -i 's/openshift-operators/gitops-operator-system/g' $temp_dir/sequential/1-018_validate_disable_default_instance/02-assert.yaml + sed -i 's/openshift-operators/openshift-gitops-operator/g' $temp_dir/sequential/1-018_validate_disable_default_instance/02-assert.yaml fi if [ -d "$temp_dir/sequential/1-035_validate_argocd_secret_repopulate" ]; then - sed -i 's/openshift-operators/gitops-operator-system/g' $temp_dir/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml + sed -i 's/openshift-operators/openshift-gitops-operator/g' $temp_dir/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml fi cleanup() { diff --git a/scripts/e2e-common.sh b/scripts/e2e-common.sh index e4edee6cb..e71f8be51 100644 --- a/scripts/e2e-common.sh +++ b/scripts/e2e-common.sh @@ -134,7 +134,7 @@ function dump_cluster_state() { function dump_extra_cluster_state() { echo ">>> Gitops controller log:" - kubectl -n openshift-operators logs $(get_app_pod argocd-operator openshift-operators) --all-containers=true + kubectl -n openshift-gitops-operator logs $(get_app_pod argocd-operator openshift-gitops-operator) --all-containers=true } @@ -251,11 +251,11 @@ function uninstall_operator_resources() { oc wait --for=delete $deployment -n openshift-gitops --timeout=5m || fail_test "Failed to delete deployment: $deployment in openshift-gitops namespace" done - oc delete $(oc get csv -n openshift-operators -o name|grep gitops) -n openshift-operators || fail_test "Unable to delete CSV" + oc delete $(oc get csv -n openshift-gitops-operator -o name|grep gitops) -n openshift-gitops-operator || fail_test "Unable to delete CSV" - oc delete -n openshift-operators installplan $(oc get subscription gitops-operator -n openshift-operators -o jsonpath='{.status.installplan.name}') || fail_test "Unable to delete installplan" + oc delete -n openshift-gitops-operator installplan $(oc get subscription gitops-operator -n openshift-gitops-operator -o jsonpath='{.status.installplan.name}') || fail_test "Unable to delete installplan" - oc delete subscription gitops-operator -n openshift-operators --cascade=background || fail_test "Unable to delete subscription" + oc delete subscription gitops-operator -n openshift-gitops-operator --cascade=background || fail_test "Unable to delete subscription" echo -e ">> Delete arogo resources accross all namespaces" for res in applications applicationsets appprojects argocds; do @@ -273,13 +273,13 @@ function uninstall_operator_resources() { function install_operator_resources() { echo -e ">>Ensure Gitops subscription exists" - oc get subscription gitops-operator -n openshift-operators 2>/dev/null || \ + oc get subscription gitops-operator -n openshift-gitops-operator 2>/dev/null || \ cat <> Wait for GitopsService creation" wait_until_object_exist "gitopsservices.pipelines.openshift.io" "cluster" "openshift-gitops" || fail_test "gitops service haven't created yet" diff --git a/scripts/openshift-CI-kuttl-tests.sh b/scripts/openshift-CI-kuttl-tests.sh index 14146adb9..03e58dd41 100755 --- a/scripts/openshift-CI-kuttl-tests.sh +++ b/scripts/openshift-CI-kuttl-tests.sh @@ -18,8 +18,8 @@ export KUBECONFIG=$TMP_DIR/kubeconfig cp $KUBECONFIG /go/src/github.com/redhat-developer/gitops-operator/kubeconfig # Ensuring proper installation -pod=gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-operators -o yaml -subscription=gitops-operator- && oc get subscription `oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators +pod=openshift-gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o yaml +subscription=gitops-operator- && oc get subscription `oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator oc wait --for=condition=Ready -n openshift-gitops pod --timeout=15m -l 'app.kubernetes.io/name in (cluster,kam,openshift-gitops-application-controller,openshift-gitops-applicationset-controller,openshift-gitops-dex-server,openshift-gitops-redis,openshift-gitops-repo-server,openshift-gitops-server)' # Check argocd instance creation diff --git a/scripts/openshift-interop-kuttl-tests.sh b/scripts/openshift-interop-kuttl-tests.sh index 11a36e67f..c8c7097f9 100755 --- a/scripts/openshift-interop-kuttl-tests.sh +++ b/scripts/openshift-interop-kuttl-tests.sh @@ -17,8 +17,8 @@ export KUBECONFIG=$TMP_DIR/kubeconfig cp $KUBECONFIG /go/src/github.com/redhat-developer/gitops-operator/kubeconfig # Ensuring proper installation -pod=gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-operators -o yaml -oc get subscription -n openshift-operators +pod=openshift-gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o yaml +oc get subscription -n openshift-gitops-operator oc wait --for=condition=Ready -n openshift-gitops pod --timeout=15m -l 'app.kubernetes.io/name in (cluster,kam,openshift-gitops-application-controller,openshift-gitops-applicationset-controller,openshift-gitops-dex-server,openshift-gitops-redis,openshift-gitops-repo-server,openshift-gitops-server)' # Check argocd instance creation diff --git a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-assert.yaml b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-assert.yaml index eb9bf5b7b..14db94442 100644 --- a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-assert.yaml +++ b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-assert.yaml @@ -1,8 +1,8 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: gitops-operator-controller-manager - namespace: openshift-operators + name: openshift-gitops-operator-controller-manager + namespace: openshift-gitops-operator status: readyReplicas: 1 replicas: 1 diff --git a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml index 483bbb01b..21283708e 100644 --- a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml +++ b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml @@ -4,17 +4,17 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":"true"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_INSTANCE", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_INSTANCE", "value": "true"}]}}}' fi - script: sleep 120 diff --git a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml index d92b0a9fe..332f439bd 100644 --- a/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml +++ b/test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml @@ -4,16 +4,16 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":null}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' fi - script: sleep 120 diff --git a/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml b/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml index 529d0dd00..ddf9f5211 100644 --- a/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml +++ b/test/openshift/e2e/parallel/1-051-validate_csv_permissions/01-validate.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | set -e - res=$(oc auth can-i delete resourcequotas -n openshift-gitops --as system:serviceaccount:openshift-operators:gitops-operator-controller-manager) + res=$(oc auth can-i delete resourcequotas -n openshift-gitops --as system:serviceaccount:openshift-gitops-operator:openshift-gitops-operator-controller-manager) if test "$res" != "yes"; then echo "Can't delete resourcequotas" exit 1 diff --git a/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml b/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml new file mode 100644 index 000000000..d66cebbf4 --- /dev/null +++ b/test/openshift/e2e/parallel/1-077_validate_disable_dex_removed/01-check_disable_dex_removed.yaml @@ -0,0 +1,19 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: +- script: | + set -e + + if [ -z $CI ]; then + operator_name_version=$(oc get subscription/openshift-gitops-operator -n openshift-gitops-operator -o jsonpath='{.status.installedCSV}') + if [ "$(oc get csv/"${operator_name_version}" -n openshift-gitops-operator -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then + echo "DISABLE_DEX env var is still present in the operator CSV." + exit 1 + fi + else + operator_name_version=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o jsonpath='{.status.installedCSV}') + if [ "$(oc get csv/"${operator_name_version}" -n openshift-gitops-operator -o jsonpath='{.spec.install.spec.deployments[].spec.template.spec.containers[].env}' | grep DISABLE_DEX)" != '' ]; then + echo "DISABLE_DEX env var is still present in the operator CSV." + exit 1 + fi + fi \ No newline at end of file diff --git a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml index 3b0e66814..afe8c90ce 100644 --- a/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml +++ b/test/openshift/e2e/parallel/1-090_validate_permissions/01-assert.yaml @@ -1,8 +1,8 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: - name: gitops-operator.v1.8.0 - namespace: openshift-operators + name: gitops-operator.v1.10.0 + namespace: openshift-gitops-operator spec: install: spec: diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml index 419a0d5d2..da26bff46 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml @@ -5,17 +5,17 @@ commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":"custom-argocd-role"},{"name":"SERVER_CLUSTER_ROLE", "value":"custom-argocd-role"}]}]}}}}' elif ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\ --type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}' else - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}' fi diff --git a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml index a0d89039c..a10ed6f37 100644 --- a/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml +++ b/test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml @@ -3,12 +3,12 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":null},{"name":"SERVER_CLUSTER_ROLE", "value":null}]}]}}}}' elif ! [ -z $CI ]; then - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' else - oc patch subscription/openshift-gitops-operator -n openshift-operators --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' + oc patch subscription/openshift-gitops-operator -n openshift-gitops-operator --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]' fi - script: sleep 10 diff --git a/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml b/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml index b36c99f33..12e333c40 100644 --- a/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml +++ b/test/openshift/e2e/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml @@ -1,12 +1,12 @@ -# Check if the gitops-operator-controller-manager pod is running +# Check if the openshift-gitops-operator-controller-manager pod is running apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - script: | - oc rollout status deployment gitops-operator-controller-manager -n openshift-operators --timeout=1m + oc rollout status deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator --timeout=1m rollout_status=$? if [ "${rollout_status}" -ne 0 ]; then - echo "gitops-operator-controller-manager deployment was not successfully rolled out" + echo "openshift-gitops-operator-controller-manager deployment was not successfully rolled out" exit 1 fi exit 0 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml new file mode 100644 index 000000000..37d4af3e5 --- /dev/null +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml @@ -0,0 +1,18 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: +- script: | + if ! [ -z $NON_OLM ]; then + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ + -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":"true"}]}]}}}}' + + elif [ -z $CI ]; then + + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ + --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": "true"}]}}}' + else + + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": "true"}]}}}' + fi +- script: sleep 30 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml new file mode 100644 index 000000000..d379656a0 --- /dev/null +++ b/test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml @@ -0,0 +1,18 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: +- script: | + if ! [ -z $NON_OLM ]; then + oc patch deployment gitops-operator-controller-manager -n openshift-gitops-operator \ + -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":""}]}]}}}}' + + elif [ -z $CI ]; then + + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ + --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": ""}]}}}' + else + + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": ""}]}}}' + fi +- script: sleep 30 \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml index 2b929b4ac..d2f2c412f 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml @@ -6,16 +6,16 @@ commands: set -e if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":"true"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", "value": "true"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml index 1470d4c85..dd39153ae 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION")|.value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 @@ -11,7 +11,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 @@ -19,7 +19,7 @@ commands: exit 0 fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value') if [ -z $label_value ]; then echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set" exit 1 diff --git a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml index c6fa44007..f86d9e9e8 100644 --- a/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml +++ b/test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml @@ -4,12 +4,12 @@ commands: # patches the subscription to set an environment variable - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":null}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type json --patch '[{"op": "remove", "path": "/spec/config"}]' fi diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml index 4250160f0..f51b4afbb 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml @@ -3,12 +3,12 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"true"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml index 843df512d..c33864cdd 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set" @@ -12,7 +12,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set" @@ -22,7 +22,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"true"' ]]; then echo "Label value: $label_value" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml index 0f0453019..04ce323e2 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml @@ -3,13 +3,13 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"false"}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml index 4d9311ad1..20b88d5ed 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == '"false"' ]]; then echo "Label value: $label_value" echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" @@ -12,7 +12,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"false"' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" @@ -22,7 +22,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '"false"' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml index 49e7b0683..096530976 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml @@ -3,13 +3,13 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":""}]}]}}}}' elif [ -z $CI ]; then - oc patch -n openshift-operators subscription openshift-gitops-operator \ + oc patch -n openshift-gitops-operator subscription openshift-gitops-operator \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}' else - oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ + oc patch -n openshift-gitops-operator subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` \ --type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml index 5f7b2bd02..46ba09587 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml @@ -3,7 +3,7 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq -r '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') + label_value=$(oc get deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator -o json | jq -r '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value') if ! [[ "${label_value}" == null ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" exit 1 @@ -11,7 +11,7 @@ commands: exit 0 fi elif [ -z $CI ]; then - label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '""' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" @@ -21,7 +21,7 @@ commands: fi else - label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') + label_value=$(oc get subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value') if ! [[ "${label_value}" == '""' ]]; then echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}" diff --git a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml index 75187c19e..a7d8c821a 100644 --- a/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml +++ b/test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml @@ -3,11 +3,11 @@ kind: TestStep commands: - script: | if ! [ -z $NON_OLM ]; then - oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \ + oc patch deployment openshift-gitops-operator-controller-manager -n openshift-gitops-operator \ -p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":null}]}]}}}}' elif [ -z $CI ]; then - oc -n openshift-operators patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' + oc -n openshift-gitops-operator patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' else - oc -n openshift-operators patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' + oc -n openshift-gitops-operator patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]' fi \ No newline at end of file diff --git a/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml b/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml index 38a85bf87..60968b2fd 100644 --- a/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml +++ b/test/openshift/e2e/sequential/1-085_validate_dynamic_plugin_installation/02-install-dynamic-plugin.yaml @@ -5,11 +5,11 @@ commands: set -eo pipefail # Get CSV name and also OCP version. - csv_name=$(oc get csv -n openshift-operators | awk '/gitops-operator/ {print $1}') + csv_name=$(oc get csv -n openshift-gitops-operator | awk '/gitops-operator/ {print $1}') ocp_version=$(oc version | awk '/Server Version/ {split($3,a,"-"); print a[1]}') # Patch the CSV to add the necessary env key:value for Dynamic Plugin - oc patch csv "${csv_name}" -n openshift-operators \ + oc patch csv "${csv_name}" -n openshift-gitops-operator \ --type='json' \ -p='[{ "op": "add",