Skip to content

Commit

Permalink
Added test for instalilng the operator in a custom namespace (#142)
Browse files Browse the repository at this point in the history
Issue #141
  • Loading branch information
Razz4780 authored Dec 19, 2024
1 parent cfcdac9 commit 880eea4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ jobs:
cpus: 'max'
memory: '4gb'
- uses: azure/[email protected]
- run: helm install mirrord-operator --set license.file.data."license\\.pem"=$MIRRORD_OPERATOR_LICENSE --set operator.disableTelemetries=true --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" --set operator.podLabels."label\.metalbear\.co/name"="operator" --set operator.podLabels."label\.metalbear\.co/version"="latest" ./mirrord-operator --wait
- uses: nick-fields/retry@v3
- name: prepare custom namespaces for `test_values/operator_rolenamespaces.yaml`
run: kubectl create namespace namespace1 && kubectl create namespace namespace2
- name: check installing the chart with various `values` yamls
run: ./test_values_files.sh
- name: install the chart
run: helm install mirrord-operator --set license.file.data."license\\.pem"=$MIRRORD_OPERATOR_LICENSE --set operator.disableTelemetries=true --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" --set operator.podLabels."label\.metalbear\.co/name"="operator" --set operator.podLabels."label\.metalbear\.co/version"="latest" ./mirrord-operator --wait
- name: wait for the operator status
uses: nick-fields/retry@v3
with:
timeout_seconds: 10
max_attempts: 5
retry_wait_seconds: 1
command: kubectl get mirrordoperators.operator.metalbear.co operator -o yaml
- name: check different values yaml files
run: ./test_values_files.sh
7 changes: 7 additions & 0 deletions test_values/operator_custom_namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
license:
file:
secret: mirrord-operator-license
data:
license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID"

namespace: custom-operator-namespace
14 changes: 9 additions & 5 deletions test_values_files.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/sh

# for each file in the test_values directory
# run helm install --dry-run=server
set -e

# For each file in the `test_values` directory
# run helm install && helm uninstall.
for file in test_values/*.yaml; do
echo "Running test for $file"
helm install --dry-run=server --debug -f $file mirrord-operator ./mirrord-operator
done
echo "::group::Running test for $file" # Groups logs in the CI dashboard
helm install --atomic --debug -f $file mirrord-operator ./mirrord-operator --wait
helm uninstall mirrord-operator --wait
echo "::endgroup::"
done

0 comments on commit 880eea4

Please sign in to comment.