Skip to content

Commit b4b7910

Browse files
authored
fix topology-rbac and kubernetes-rbac tests in k8s jobs (#4656)
1 parent 2a77e36 commit b4b7910

4 files changed

Lines changed: 30 additions & 17 deletions

File tree

.ci/pipelines/lib/operators.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ operator::install_pipelines() {
109109
return 0
110110
}
111111

112+
# Install Tekton Pipelines (alternative to OpenShift Pipelines for Kubernetes)
113+
operator::install_tekton() {
114+
local display_name="tekton-pipelines-webhook"
115+
local ns="tekton-pipelines"
116+
117+
if ! kubectl get namespace "${ns}" &> /dev/null; then
118+
log::info "Tekton Pipelines is not installed. Installing..."
119+
kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
120+
else
121+
log::info "Tekton Pipelines namespace exists; ensuring webhook is ready before continuing."
122+
fi
123+
124+
log::info "Waiting for Tekton Pipeline CRD and webhook (required before applying Pipeline manifests)..."
125+
k8s_wait::crd "pipelines.tekton.dev" 120 5 || return 1
126+
k8s_wait::deployment "${ns}" "${display_name}" 30 10 || return 1
127+
k8s_wait::endpoint "${display_name}" "${ns}" 1800 10 || return 1
128+
return 0
129+
}
130+
112131
# Install Operator Lifecycle Manager if not present
113132
operator::install_olm() {
114133
if operator-sdk olm status > /dev/null 2>&1; then

.ci/pipelines/utils.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -372,17 +372,13 @@ apply_yaml_files() {
372372
common::create_configmap_from_file "dynamic-global-header-config" "$project" \
373373
"dynamic-global-header-config.yaml" "$dir/resources/config_map/dynamic-global-header-config.yaml"
374374

375-
# Skip Topology resources for K8s deployments (AKS/EKS/GKE)
376-
if [[ "$JOB_NAME" != *"aks"* && "$JOB_NAME" != *"eks"* && "$JOB_NAME" != *"gke"* ]]; then
377-
# Create Deployment and Pipeline for Topology test.
378-
oc apply -f "$dir/resources/topology_test/topology-test.yaml" --namespace="${project}"
379-
if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then
380-
kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml" --namespace="${project}"
381-
else
382-
oc apply -f "$dir/resources/topology_test/topology-test-route.yaml" --namespace="${project}"
383-
fi
375+
# Create Deployment and Pipeline for Topology test.
376+
oc apply -f "$dir/resources/topology_test/topology-test.yaml" --namespace="${project}"
377+
378+
if [[ -z "${IS_OPENSHIFT}" || "${IS_OPENSHIFT}" == "false" ]]; then
379+
kubectl apply -f "$dir/resources/topology_test/topology-test-ingress.yaml" --namespace="${project}"
384380
else
385-
log::info "Skipping Topology resources for K8s deployment (${JOB_NAME})"
381+
oc apply -f "$dir/resources/topology_test/topology-test-route.yaml" --namespace="${project}"
386382
fi
387383

388384
rm -rf "${tmpdir}"
@@ -478,12 +474,16 @@ cluster_setup_ocp_operator() {
478474

479475
cluster_setup_k8s_operator() {
480476
operator::install_olm
477+
# Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work
478+
operator::install_tekton
481479
# operator::install_postgres_k8s # Works with K8s but disabled in values file
482480
}
483481

484482
cluster_setup_k8s_helm() {
485-
log::info "No additional cluster setup required for K8s Helm deployment"
483+
# Install Tekton Pipelines for K8s deployments (AKS/EKS/GKE) for topology tests to work
484+
log::info "Installing Tekton Pipelines for K8s Helm deployment"
486485
# operator::install_olm
486+
operator::install_tekton
487487
# operator::install_postgres_k8s # Works with K8s but disabled in values file
488488
}
489489

e2e-tests/playwright/e2e/plugins/kubernetes/kubernetes-rbac.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import { KUBERNETES_COMPONENTS } from "../../../support/page-objects/page-obj";
66
import { KubernetesPage } from "../../../support/pages/kubernetes";
77

88
test.describe("Test Kubernetes Plugin", () => {
9-
// TODO: https://issues.redhat.com/browse/RHDHBUGS-2817
10-
test.fixme(() => process.env.IS_OPENSHIFT === "false");
11-
129
let common: Common;
1310
let uiHelper: UIhelper;
1411
let catalog: Catalog;

e2e-tests/playwright/e2e/plugins/topology/topology-rbac.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import { Catalog } from "../../../support/pages/catalog";
55
import { Topology } from "../../../support/pages/topology";
66

77
test.describe("Test Topology Plugin with RBAC", () => {
8-
// TODO: https://issues.redhat.com/browse/RHDHBUGS-2817
9-
test.fixme(() => process.env.IS_OPENSHIFT === "false");
10-
118
let common: Common;
129
let uiHelper: UIhelper;
1310
let catalog: Catalog;

0 commit comments

Comments
 (0)