Skip to content

Commit

Permalink
Add nginx-ingress-operator for testing (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnshr authored Nov 28, 2024
1 parent 500b75c commit 6800d3a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/delete-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ operator-sdk cleanup nginx-operator -n "$CERTSUITE_EXAMPLE_NAMESPACE"

#Wait until pod is deleted
until [[ -z "$(oc get pod "$OPERATOR_REGISTRY_POD_NAME" -n "$CERTSUITE_EXAMPLE_NAMESPACE" 2>/dev/null)" ]]; do sleep 5; done

# Delete nginx-operator in ninginx-ops namespace
echo "Deleting nginx-ingress-operator .."

NGINX_OPERATOR_NS="nginx-ops"
NGINX_APPS_NS="nginx-apps"

CSV=$(oc get subscription nginx-ingress-operator -n "$NGINX_OPERATOR_NS" -o json | jq -r '.status.installedCSV')
oc delete subscription nginx-ingress-operator -n "$NGINX_OPERATOR_NS"
oc delete csv "$CSV" -n "$NGINX_OPERATOR_NS"
oc delete csv "$CSV" -n "$NGINX_APPS_NS"

oc delete namespace "$NGINX_OPERATOR_NS"
oc delete namespace "$NGINX_APPS_NS"
3 changes: 3 additions & 0 deletions scripts/deploy-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ else
echo "ERROR: CSV not deployed. Operator deployment failed -- interrupting tests"
exit 1
fi

# deploy single namespace operator nginx in namespace nginx-ops
oc apply --filename ./test-target/operator-single-install-mode.yaml
37 changes: 37 additions & 0 deletions test-target/operator-single-install-mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-ops

---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-apps

---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: nginx-og
namespace: nginx-ops
spec:
targetNamespaces:
- nginx-apps

---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: nginx-ingress-operator
namespace: nginx-ops
labels:
nginx-ingress-operator.v2.4.2
spec:
channel: alpha
installPlanApproval: Automatic
name: nginx-ingress-operator
source: certified-operators
sourceNamespace: openshift-marketplace

0 comments on commit 6800d3a

Please sign in to comment.