diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c823f98..8001f62 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,12 +33,16 @@ jobs: cpus: 'max' memory: '4gb' - uses: azure/setup-helm@v4.1.0 - - 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 diff --git a/test_values/operator_custom_namespace.yaml b/test_values/operator_custom_namespace.yaml new file mode 100644 index 0000000..acfc2ea --- /dev/null +++ b/test_values/operator_custom_namespace.yaml @@ -0,0 +1,7 @@ +license: + file: + secret: mirrord-operator-license + data: + license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID" + +namespace: custom-operator-namespace diff --git a/test_values_files.sh b/test_values_files.sh index 8192b18..344f0c1 100755 --- a/test_values_files.sh +++ b/test_values_files.sh @@ -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 \ No newline at end of file + 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