diff --git a/.ci/pipelines/lib/operators.sh b/.ci/pipelines/lib/operators.sh index 8debbe5d52..7f5f933c5c 100644 --- a/.ci/pipelines/lib/operators.sh +++ b/.ci/pipelines/lib/operators.sh @@ -112,19 +112,20 @@ operator::install_pipelines() { # Install Tekton Pipelines (alternative to OpenShift Pipelines for Kubernetes) operator::install_tekton() { local display_name="tekton-pipelines-webhook" + local ns="tekton-pipelines" - if oc get pods -n "tekton-pipelines" | grep -q "${display_name}"; then - log::info "Tekton Pipelines are already installed." - return 0 + if ! kubectl get namespace "${ns}" &> /dev/null; then + log::info "Tekton Pipelines is not installed. Installing..." + kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml + else + log::info "Tekton Pipelines namespace exists; ensuring webhook is ready before continuing." fi - log::info "Tekton Pipelines is not installed. Installing..." - kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml - - # Note: Calling script should wait for deployment: - # k8s_wait::deployment "tekton-pipelines" "${display_name}" - # k8s_wait::endpoint "tekton-pipelines-webhook" "tekton-pipelines" - return $? + log::info "Waiting for Tekton Pipeline CRD and webhook (required before applying Pipeline manifests)..." + k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1 + k8s_wait::deployment "${ns}" "${display_name}" 30 10 || return 1 + k8s_wait::endpoint "${display_name}" "${ns}" 1800 10 || return 1 + return 0 } # Delete Tekton Pipelines installation diff --git a/.ci/pipelines/utils.sh b/.ci/pipelines/utils.sh index 71c3137413..b09bb7fd0c 100755 --- a/.ci/pipelines/utils.sh +++ b/.ci/pipelines/utils.sh @@ -345,23 +345,26 @@ apply_yaml_files() { common::create_configmap_from_file "dynamic-global-header-config" "$project" \ "dynamic-global-header-config.yaml" "$dir/resources/config_map/dynamic-global-header-config.yaml" - # Skip Tekton and Topology resources for K8s deployments (AKS/EKS/GKE) + # Skip Tekton resources for K8s deployments (AKS/EKS/GKE) # Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects if [[ "$JOB_NAME" != *"aks"* && "$JOB_NAME" != *"eks"* && "$JOB_NAME" != *"gke"* ]]; then # Create Pipeline run for tekton test case. oc apply -f "$dir/resources/pipeline-run/hello-world-pipeline.yaml" oc apply -f "$dir/resources/pipeline-run/hello-world-pipeline-run.yaml" - # Create Deployment and Pipeline for Topology test. - oc apply -f "$dir/resources/topology_test/topology-test.yaml" - if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then - kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml" - else - oc apply -f "$dir/resources/topology_test/topology-test-route.yaml" - fi else - log::info "Skipping Tekton Pipeline and Topology resources for K8s deployment (${JOB_NAME})" + log::info "Skipping Tekton Pipeline resources for K8s deployment (${JOB_NAME})" + fi + + # Create Deployment and Pipeline for Topology test. + oc apply -f "$dir/resources/topology_test/topology-test.yaml" + + if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then + kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml" + else + oc apply -f "$dir/resources/topology_test/topology-test-route.yaml" fi + } deploy_test_backstage_customization_provider() { @@ -408,11 +411,8 @@ install_pipelines_operator() { fi # Wait for Tekton Pipeline CRD to be registered before proceeding k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1 -} - -waitfor_pipelines_operator() { - k8s_wait::deployment "openshift-operators" "pipelines" - k8s_wait::endpoint "tekton-pipelines-webhook" "openshift-pipelines" + k8s_wait::deployment "openshift-operators" "pipelines" 30 10 || return 1 + k8s_wait::endpoint "${TEKTON_PIPELINES_WEBHOOK}" "openshift-pipelines" 1800 10 || return 1 } # Installs the Tekton Pipelines if not already installed (alternative of OpenShift Pipelines for Kubernetes clusters) @@ -424,16 +424,12 @@ install_tekton_pipelines() { else log::info "Tekton Pipelines is not installed. Installing..." kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml + k8s_wait::deployment "tekton-pipelines" "tekton-pipelines-webhook" 30 10 || return 1 + k8s_wait::endpoint "tekton-pipelines-webhook" "tekton-pipelines" 1800 10 || return 1 + k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1 fi } -waitfor_tekton_pipelines() { - local display_name="tekton-pipelines-webhook" - k8s_wait::deployment "tekton-pipelines" "${display_name}" - k8s_wait::endpoint "tekton-pipelines-webhook" "tekton-pipelines" - k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1 -} - delete_tekton_pipelines() { log::info "Checking for Tekton Pipelines installation..." if ! kubectl get namespace tekton-pipelines &> /dev/null; then @@ -483,12 +479,6 @@ enable_orchestrator_plugins_op() { cluster_setup_ocp_helm() { operator::install_pipelines - - # Wait for OpenShift Pipelines to be ready before proceeding - log::info "Waiting for OpenShift Pipelines to be ready..." - k8s_wait::deployment "${OPERATOR_NAMESPACE}" "pipelines" 30 10 || return 1 - k8s_wait::endpoint "${TEKTON_PIPELINES_WEBHOOK}" "openshift-pipelines" 1800 10 || return 1 - operator::install_postgres_ocp # Skip orchestrator infra installation based on job type (see should_skip_orchestrator) @@ -501,12 +491,6 @@ cluster_setup_ocp_helm() { cluster_setup_ocp_operator() { operator::install_pipelines - - # Wait for OpenShift Pipelines to be ready before proceeding - log::info "Waiting for OpenShift Pipelines to be ready..." - k8s_wait::deployment "${OPERATOR_NAMESPACE}" "pipelines" 30 10 || return 1 - k8s_wait::endpoint "${TEKTON_PIPELINES_WEBHOOK}" "openshift-pipelines" 1800 10 || return 1 - operator::install_postgres_ocp operator::install_serverless operator::install_serverless_logic @@ -514,18 +498,16 @@ cluster_setup_ocp_operator() { cluster_setup_k8s_operator() { operator::install_olm - # Tekton not installed for K8s deployments (AKS/EKS/GKE) - # Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects - # operator::install_tekton + # Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work + operator::install_tekton # operator::install_postgres_k8s # Works with K8s but disabled in values file } cluster_setup_k8s_helm() { - # Tekton not installed for K8s deployments (AKS/EKS/GKE) - # Tekton tests are not executed in showcase-k8s or showcase-rbac-k8s projects - log::info "Skipping Tekton installation for K8s Helm deployment" + # Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work + log::info "Installing Tekton Pipelines for K8s Helm deployment" # operator::install_olm - # operator::install_tekton + operator::install_tekton # operator::install_postgres_k8s # Works with K8s but disabled in values file } diff --git a/e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts b/e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts index e7b52d940c..09747072bd 100644 --- a/e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts @@ -6,9 +6,6 @@ import { KUBERNETES_COMPONENTS } from "../../../support/page-objects/page-obj"; import { KubernetesPage } from "../../../support/pages/kubernetes"; test.describe("Test Kubernetes Plugin", () => { - // TODO: https://issues.redhat.com/browse/RHDHBUGS-2817 - test.fixme(() => process.env.IS_OPENSHIFT === "false"); - let common: Common; let uiHelper: UIhelper; let catalog: Catalog; diff --git a/e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts b/e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts index 6c5274db76..506b78b2fd 100644 --- a/e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts @@ -5,9 +5,6 @@ import { Catalog } from "../../../support/pages/catalog"; import { Topology } from "../../../support/pages/topology"; test.describe("Test Topology Plugin with RBAC", () => { - // TODO: https://issues.redhat.com/browse/RHDHBUGS-2817 - test.fixme(() => process.env.IS_OPENSHIFT === "false"); - let common: Common; let uiHelper: UIhelper; let catalog: Catalog; diff --git a/e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts b/e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts index 920583f8ae..985809fb95 100644 --- a/e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts @@ -119,9 +119,7 @@ async function testIngressResources(page: Page, uiHelper: UIhelper) { .first(), ).toBeVisible(); // Verify code block is visible (pre element containing configuration) - await expect( - page.getByText(/apiVersion:|kind:|metadata:/).first(), - ).toBeVisible(); + await expect(page.getByText(/rules:/).first()).toBeVisible(); } async function testRouteResources(page: Page, uiHelper: UIhelper) {