Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,95 +127,7 @@ tests:
TLS_13_TLS_ADHERENCE_POLICY: StrictAllComponents
test:
- ref: optional-operators-operator-sdk
- as: wait-for-server-pods
cli: latest
commands: |
NAMESPACE=oran-o2ims
echo "Waiting for Inventory CR to be auto-created..."
for i in $(seq 1 60); do
if oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "Inventory CR 'default' found."
break
fi
echo " attempt $i/60..."
sleep 5
done

if ! oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "ERROR: Inventory CR 'default' was not created after 5 minutes"
exit 1
fi

echo ""
echo "Discovering services with TLS serving certs..."
TLS_SERVICES=$(oc get services -n "$NAMESPACE" \
-o jsonpath='{range .items[?(@.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name)]}{.metadata.name}{"\n"}{end}')

echo "TLS services found:"
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
echo " $svc -> secret: $SECRET"
done <<< "$TLS_SERVICES"

echo ""
echo "Waiting for TLS service pods to be ready..."
FAILED=false
while read -r svc; do
[ -z "$svc" ] && continue
SELECTOR=$(oc get service "$svc" -n "$NAMESPACE" \
-o go-template='{{range $k,$v := .spec.selector}}{{$k}}={{$v}},{{end}}' | sed 's/,$//')
if [ -z "$SELECTOR" ]; then
echo " SKIP: $svc has no selector"
continue
fi
echo " $svc (selector: $SELECTOR)..."
if ! oc wait pods -l "$SELECTOR" -n "$NAMESPACE" \
--for=condition=Ready --timeout=5m; then
echo " ERROR: pods for $svc did not become ready within 5m"
echo " Pod status:"
oc get pods -l "$SELECTOR" -n "$NAMESPACE" --no-headers | sed 's/^/ /'
echo " Recent events:"
oc get events -n "$NAMESPACE" --field-selector reason!=Pulling,reason!=Pulled \
--sort-by='.lastTimestamp' 2>/dev/null | grep "$svc" | tail -5 | sed 's/^/ /' \
|| echo " (no events found)"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS service pods failed readiness checks"
exit 1
fi

echo ""
echo "Verifying TLS secrets from service-ca..."
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
if oc get secret "$SECRET" -n "$NAMESPACE" &>/dev/null; then
echo " $SECRET exists"
else
echo " ERROR: $SECRET not found"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS secrets are missing"
exit 1
fi

echo ""
echo "Final pod status in $NAMESPACE:"
oc get pods -n "$NAMESPACE"
from: cli
resources:
requests:
cpu: 100m
memory: 200Mi
- ref: oran-o2ims-wait-for-tls-pods
- ref: tls-13
- ref: tls-scanner-run
workflow: ipi-aws
Expand All @@ -235,95 +147,7 @@ tests:
TLS_13_TLS_ADHERENCE_POLICY: StrictAllComponents
test:
- ref: optional-operators-operator-sdk
- as: wait-for-server-pods
cli: latest
commands: |
NAMESPACE=oran-o2ims
echo "Waiting for Inventory CR to be auto-created..."
for i in $(seq 1 60); do
if oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "Inventory CR 'default' found."
break
fi
echo " attempt $i/60..."
sleep 5
done

if ! oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "ERROR: Inventory CR 'default' was not created after 5 minutes"
exit 1
fi

echo ""
echo "Discovering services with TLS serving certs..."
TLS_SERVICES=$(oc get services -n "$NAMESPACE" \
-o jsonpath='{range .items[?(@.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name)]}{.metadata.name}{"\n"}{end}')

echo "TLS services found:"
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
echo " $svc -> secret: $SECRET"
done <<< "$TLS_SERVICES"

echo ""
echo "Waiting for TLS service pods to be ready..."
FAILED=false
while read -r svc; do
[ -z "$svc" ] && continue
SELECTOR=$(oc get service "$svc" -n "$NAMESPACE" \
-o go-template='{{range $k,$v := .spec.selector}}{{$k}}={{$v}},{{end}}' | sed 's/,$//')
if [ -z "$SELECTOR" ]; then
echo " SKIP: $svc has no selector"
continue
fi
echo " $svc (selector: $SELECTOR)..."
if ! oc wait pods -l "$SELECTOR" -n "$NAMESPACE" \
--for=condition=Ready --timeout=5m; then
echo " ERROR: pods for $svc did not become ready within 5m"
echo " Pod status:"
oc get pods -l "$SELECTOR" -n "$NAMESPACE" --no-headers | sed 's/^/ /'
echo " Recent events:"
oc get events -n "$NAMESPACE" --field-selector reason!=Pulling,reason!=Pulled \
--sort-by='.lastTimestamp' 2>/dev/null | grep "$svc" | tail -5 | sed 's/^/ /' \
|| echo " (no events found)"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS service pods failed readiness checks"
exit 1
fi

echo ""
echo "Verifying TLS secrets from service-ca..."
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
if oc get secret "$SECRET" -n "$NAMESPACE" &>/dev/null; then
echo " $SECRET exists"
else
echo " ERROR: $SECRET not found"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS secrets are missing"
exit 1
fi

echo ""
echo "Final pod status in $NAMESPACE:"
oc get pods -n "$NAMESPACE"
from: cli
resources:
requests:
cpu: 100m
memory: 200Mi
- ref: oran-o2ims-wait-for-tls-pods
- ref: tls-13
- ref: tls-scanner-run
workflow: ipi-aws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,95 +127,7 @@ tests:
TLS_13_TLS_ADHERENCE_POLICY: StrictAllComponents
test:
- ref: optional-operators-operator-sdk
- as: wait-for-server-pods
cli: latest
commands: |
NAMESPACE=oran-o2ims
echo "Waiting for Inventory CR to be auto-created..."
for i in $(seq 1 60); do
if oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "Inventory CR 'default' found."
break
fi
echo " attempt $i/60..."
sleep 5
done

if ! oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "ERROR: Inventory CR 'default' was not created after 5 minutes"
exit 1
fi

echo ""
echo "Discovering services with TLS serving certs..."
TLS_SERVICES=$(oc get services -n "$NAMESPACE" \
-o jsonpath='{range .items[?(@.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name)]}{.metadata.name}{"\n"}{end}')

echo "TLS services found:"
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
echo " $svc -> secret: $SECRET"
done <<< "$TLS_SERVICES"

echo ""
echo "Waiting for TLS service pods to be ready..."
FAILED=false
while read -r svc; do
[ -z "$svc" ] && continue
SELECTOR=$(oc get service "$svc" -n "$NAMESPACE" \
-o go-template='{{range $k,$v := .spec.selector}}{{$k}}={{$v}},{{end}}' | sed 's/,$//')
if [ -z "$SELECTOR" ]; then
echo " SKIP: $svc has no selector"
continue
fi
echo " $svc (selector: $SELECTOR)..."
if ! oc wait pods -l "$SELECTOR" -n "$NAMESPACE" \
--for=condition=Ready --timeout=5m; then
echo " ERROR: pods for $svc did not become ready within 5m"
echo " Pod status:"
oc get pods -l "$SELECTOR" -n "$NAMESPACE" --no-headers | sed 's/^/ /'
echo " Recent events:"
oc get events -n "$NAMESPACE" --field-selector reason!=Pulling,reason!=Pulled \
--sort-by='.lastTimestamp' 2>/dev/null | grep "$svc" | tail -5 | sed 's/^/ /' \
|| echo " (no events found)"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS service pods failed readiness checks"
exit 1
fi

echo ""
echo "Verifying TLS secrets from service-ca..."
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
if oc get secret "$SECRET" -n "$NAMESPACE" &>/dev/null; then
echo " $SECRET exists"
else
echo " ERROR: $SECRET not found"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS secrets are missing"
exit 1
fi

echo ""
echo "Final pod status in $NAMESPACE:"
oc get pods -n "$NAMESPACE"
from: cli
resources:
requests:
cpu: 100m
memory: 200Mi
- ref: oran-o2ims-wait-for-tls-pods
- ref: tls-13
- ref: tls-scanner-run
workflow: ipi-aws
Expand All @@ -235,95 +147,7 @@ tests:
TLS_13_TLS_ADHERENCE_POLICY: StrictAllComponents
test:
- ref: optional-operators-operator-sdk
- as: wait-for-server-pods
cli: latest
commands: |
NAMESPACE=oran-o2ims
echo "Waiting for Inventory CR to be auto-created..."
for i in $(seq 1 60); do
if oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "Inventory CR 'default' found."
break
fi
echo " attempt $i/60..."
sleep 5
done

if ! oc get inventory default -n "$NAMESPACE" &>/dev/null; then
echo "ERROR: Inventory CR 'default' was not created after 5 minutes"
exit 1
fi

echo ""
echo "Discovering services with TLS serving certs..."
TLS_SERVICES=$(oc get services -n "$NAMESPACE" \
-o jsonpath='{range .items[?(@.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name)]}{.metadata.name}{"\n"}{end}')

echo "TLS services found:"
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
echo " $svc -> secret: $SECRET"
done <<< "$TLS_SERVICES"

echo ""
echo "Waiting for TLS service pods to be ready..."
FAILED=false
while read -r svc; do
[ -z "$svc" ] && continue
SELECTOR=$(oc get service "$svc" -n "$NAMESPACE" \
-o go-template='{{range $k,$v := .spec.selector}}{{$k}}={{$v}},{{end}}' | sed 's/,$//')
if [ -z "$SELECTOR" ]; then
echo " SKIP: $svc has no selector"
continue
fi
echo " $svc (selector: $SELECTOR)..."
if ! oc wait pods -l "$SELECTOR" -n "$NAMESPACE" \
--for=condition=Ready --timeout=5m; then
echo " ERROR: pods for $svc did not become ready within 5m"
echo " Pod status:"
oc get pods -l "$SELECTOR" -n "$NAMESPACE" --no-headers | sed 's/^/ /'
echo " Recent events:"
oc get events -n "$NAMESPACE" --field-selector reason!=Pulling,reason!=Pulled \
--sort-by='.lastTimestamp' 2>/dev/null | grep "$svc" | tail -5 | sed 's/^/ /' \
|| echo " (no events found)"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS service pods failed readiness checks"
exit 1
fi

echo ""
echo "Verifying TLS secrets from service-ca..."
while read -r svc; do
[ -z "$svc" ] && continue
SECRET=$(oc get service "$svc" -n "$NAMESPACE" \
-o jsonpath='{.metadata.annotations.service\.beta\.openshift\.io/serving-cert-secret-name}')
if oc get secret "$SECRET" -n "$NAMESPACE" &>/dev/null; then
echo " $SECRET exists"
else
echo " ERROR: $SECRET not found"
FAILED=true
fi
done <<< "$TLS_SERVICES"

if [ "$FAILED" = true ]; then
echo "ERROR: one or more TLS secrets are missing"
exit 1
fi

echo ""
echo "Final pod status in $NAMESPACE:"
oc get pods -n "$NAMESPACE"
from: cli
resources:
requests:
cpu: 100m
memory: 200Mi
- ref: oran-o2ims-wait-for-tls-pods
- ref: tls-13
- ref: tls-scanner-run
workflow: ipi-aws
Expand Down
8 changes: 8 additions & 0 deletions ci-operator/step-registry/oran-o2ims/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- alegacy
- donpenney
- rauhersu
reviewers:
- alegacy
- donpenney
- rauhersu
Loading