From fcbdd933c58794bf38c1c69915cdf923eff25200 Mon Sep 17 00:00:00 2001 From: Olha Yevtushenko Date: Fri, 1 Nov 2024 13:02:20 +0200 Subject: [PATCH] helm: fix tolerations schema definition --- .github/workflows/helm-release.yaml | 33 +++++++++++++++------------ charts/k6-operator/values.schema.json | 3 ++- charts/k6-operator/values.yaml | 4 ++-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index c4fe41d5..ca179a8d 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -21,23 +21,28 @@ jobs: run: | make helm-schema - - name: Configure Git + - name: Branch run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + git checkout -b helm/schema-update + git add charts/k6-operator/values.schema.json + git diff --cached | tee diff.file + echo "WC_DIFF=$(wc -c < diff.file)" >> "$GITHUB_OUTPUT" - - name: Commit and push changes - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: "Make PR" + if: ${{ steps.branch.WC_DIFF }} > 0 run: | - git add charts/k6-operator/values.schema.json - - if git diff-index --quiet HEAD; then - echo "No updates to helm values schema" - else - git commit -m "gen schema json" - git push origin HEAD:helm-schema - fi + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git commit -m "auto: generate schema json" + git push -u origin helm/schema-update + gh pr create --title "Helm schema update" -B main -H helm/schema-update --body "Auto-generated by Github Workflow" + + # We're failing here, so that maintainer can review the PR and merge it. Then Helm release should be re-run. + echo "Review the PR with schema update and re-run Helm release." + exit 1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} call-update-helm-repo: needs: diff --git a/charts/k6-operator/values.schema.json b/charts/k6-operator/values.schema.json index 45488047..6e6457db 100644 --- a/charts/k6-operator/values.schema.json +++ b/charts/k6-operator/values.schema.json @@ -310,9 +310,10 @@ }, "tolerations": { "additionalProperties": true, + "items": {}, "description": "tolerations -- Tolerations to be applied on all containers", "title": "tolerations", - "type": "object" + "type": "array" } }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/charts/k6-operator/values.yaml b/charts/k6-operator/values.yaml index f0c80f9e..facdba36 100644 --- a/charts/k6-operator/values.yaml +++ b/charts/k6-operator/values.yaml @@ -74,10 +74,10 @@ affinity: {} # @schema # additionalProperties: true # required: false -# type: object +# type: array # @schema # tolerations -- Tolerations to be applied on all containers -tolerations: {} +tolerations: [] # @schema # required: false