Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm: fix tolerations schema definition #484

Merged
merged 1 commit into from
Nov 1, 2024
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
33 changes: 19 additions & 14 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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:
Expand Down
3 changes: 2 additions & 1 deletion charts/k6-operator/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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#",
Expand Down
4 changes: 2 additions & 2 deletions charts/k6-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading