Skip to content
Open
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
21 changes: 11 additions & 10 deletions .ci/pipelines/lib/operators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
62 changes: 22 additions & 40 deletions .ci/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,23 +345,26 @@
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() {
Expand Down Expand Up @@ -408,11 +411,8 @@
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)
Expand All @@ -424,16 +424,12 @@
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

Check warning on line 428 in .ci/pipelines/utils.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of using the literal 'tekton-pipelines-webhook' 4 times.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh&issues=AZ2wyWCOJlNvP6kej7ik&open=AZ2wyWCOJlNvP6kej7ik&pullRequest=4656
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
Expand Down Expand Up @@ -481,14 +477,8 @@
return $?
}

cluster_setup_ocp_helm() {

Check warning on line 480 in .ci/pipelines/utils.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add an explicit return statement at the end of the function.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh&issues=AZ26R1POYmQjZ5Fig8_7&open=AZ26R1POYmQjZ5Fig8_7&pullRequest=4656
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)
Expand All @@ -499,33 +489,25 @@
fi
}

cluster_setup_ocp_operator() {

Check warning on line 492 in .ci/pipelines/utils.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add an explicit return statement at the end of the function.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh&issues=AZ26R1POYmQjZ5Fig8_8&open=AZ26R1POYmQjZ5Fig8_8&pullRequest=4656
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
}

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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading