feat: support custom labels, annotations and external mounts #294
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| helm-ct-lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| helm-version: | |
| - v3.16.4 | |
| - v4.2.0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: ${{ matrix.helm-version }} | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@v2.8.0 | |
| - name: Run ct lint | |
| run: ct lint --config .github/ct.yaml --all | |
| helm-unittest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| helm-version: | |
| - v3.16.4 | |
| - v4.2.0 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: ${{ matrix.helm-version }} | |
| - name: Install helm-unittest plugin | |
| # `helm plugin install --version` does NOT pin to a git tag — it | |
| # clones the default branch. Clone the v1.0.3 tag explicitly and | |
| # install from local path. v1.0.3 is the latest helm-unittest | |
| # release whose plugin.yaml does NOT use the `platformHooks` field; | |
| # v1.1.0+ adds that field, which Helm 3.16.4 rejects during | |
| # plugin.yaml parsing. Pinning to v1.0.3 keeps both matrix variants | |
| # (Helm 3 and Helm 4) compatible. | |
| # Local-path install also sidesteps Helm 4's signature verification. | |
| run: | | |
| git clone --depth 1 --branch v1.0.3 https://github.com/helm-unittest/helm-unittest /tmp/helm-unittest | |
| helm plugin install /tmp/helm-unittest | |
| - name: Run helm unittest | |
| run: helm unittest charts/graylog | |
| helm-ct-install: | |
| runs-on: ubuntu-latest | |
| needs: [helm-ct-lint, helm-unittest] | |
| strategy: | |
| fail-fast: false | |
| # Asymmetric K8s × Helm matrix: full K8s coverage on Helm 3 (the chart's | |
| # stated minimum per docs/TESTING.md), with Helm 4 added as bonus coverage | |
| # on the most recent K8s version. Expand by adding more `include:` entries. | |
| matrix: | |
| include: | |
| - helm-version: v3.16.4 | |
| k8s-version: v1.32.11 | |
| - helm-version: v3.16.4 | |
| k8s-version: v1.33.7 | |
| - helm-version: v3.16.4 | |
| k8s-version: v1.34.3 | |
| - helm-version: v4.2.0 | |
| k8s-version: v1.34.3 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: ${{ matrix.helm-version }} | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@v2.8.0 | |
| - name: Create kind cluster | |
| uses: helm/kind-action@v1.14.0 | |
| with: | |
| node_image: kindest/node:${{ matrix.k8s-version }} | |
| - name: Install MongoDB Kubernetes Operator | |
| run: | | |
| helm upgrade --install mongodb-kubernetes-operator mongodb-kubernetes \ | |
| --repo https://mongodb.github.io/helm-charts \ | |
| --version "1.6.1" \ | |
| --set operator.watchNamespace="*" \ | |
| --namespace operators \ | |
| --create-namespace \ | |
| --wait \ | |
| --timeout 5m | |
| - name: Generate ephemeral CI rootPassword and mask in workflow logs | |
| id: ci-root-password | |
| run: | | |
| password=$(openssl rand -hex 16) | |
| echo "::add-mask::${password}" | |
| echo "value=${password}" >> "$GITHUB_OUTPUT" | |
| - name: Run ct install | |
| run: | | |
| ct install --config .github/ct.yaml --all \ | |
| --helm-extra-set-args "\ | |
| --set graylog.config.rootPassword=${{ steps.ci-root-password.outputs.value }} \ | |
| --set graylog.replicas=1 \ | |
| --set datanode.replicas=1 \ | |
| --set mongodb.replicas=1 \ | |
| --set mongodb.arbiters=0 \ | |
| --set graylog.resources.requests.cpu=250m \ | |
| --set graylog.resources.requests.memory=512Mi \ | |
| --set-string graylog.resources.limits.cpu=1 \ | |
| --set graylog.resources.limits.memory=1Gi \ | |
| --set datanode.resources.requests.cpu=250m \ | |
| --set datanode.resources.requests.memory=1Gi \ | |
| --set-string datanode.resources.limits.cpu=1 \ | |
| --set datanode.resources.limits.memory=2Gi" |