Skip to content

Commit

Permalink
backport PSS helm flag
Browse files Browse the repository at this point in the history
  • Loading branch information
whites11 committed Apr 22, 2024
1 parent 035b5a5 commit 9583324
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 101 deletions.
23 changes: 4 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
architect: giantswarm/architect@4.27.0
architect: giantswarm/architect@5.1.1

workflows:
build:
Expand All @@ -14,24 +14,9 @@ workflows:
tags:
only: /^v.*/

- architect/push-to-docker:
- architect/push-to-registries:
context: architect
name: push-cluster-operator-to-quay
image: "quay.io/giantswarm/cluster-operator"
username_envar: "QUAY_USERNAME"
password_envar: "QUAY_PASSWORD"
requires:
- go-build
filters:
tags:
only: /^v.*/

- architect/push-to-docker:
context: architect
name: push-cluster-operator-to-aliyun
image: "registry-intl.cn-shanghai.aliyuncs.com/giantswarm/cluster-operator"
username_envar: "ALIYUN_USERNAME"
password_envar: "ALIYUN_PASSWORD"
name: push-to-registries
requires:
- go-build
filters:
Expand All @@ -45,7 +30,7 @@ workflows:
app_catalog_test: "control-plane-test-catalog"
chart: "cluster-operator"
requires:
- push-cluster-operator-to-quay
- push-to-registries
filters:
tags:
only: /^v.*/
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Checklist

- [ ] Update changelog in CHANGELOG.md.
8 changes: 4 additions & 4 deletions .github/workflows/zz_generated.add-team-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: users
path: artifacts/users.yaml
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
needs: build_user_list
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
id: download-users
with:
name: users
Expand All @@ -45,7 +45,7 @@ jobs:
done
echo "EOF" >> $GITHUB_ENV
- name: Apply label to issue
if: ${{ env.LABEL != '' }}
if: ${{ env.LABEL != '' && env.LABEL != 'null' && env.LABEL != null }}
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.ISSUE_AUTOMATION }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/zz_generated.add-to-project-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/user-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: users
path: artifacts/users.yaml
Expand All @@ -28,9 +28,9 @@ jobs:
mkdir -p artifacts
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
-O artifacts/labels.yaml \
https://raw.githubusercontent.com/giantswarm/github/master/tools/issue-automation/label-mapping.yaml
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/label-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: labels
path: artifacts/labels.yaml
Expand All @@ -42,7 +42,7 @@ jobs:
needs: build_user_list
if: github.event.action == 'assigned'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
id: download-users
with:
name: users
Expand All @@ -56,7 +56,7 @@ jobs:
echo "BOARD=${BOARD}" >> $GITHUB_ENV
- name: Add issue to personal board
if: ${{ env.BOARD != 'null' && env.BOARD != '' }}
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
uses: actions/add-to-project@main
with:
project-url: ${{ env.BOARD }}
Expand All @@ -68,7 +68,7 @@ jobs:
needs: build_user_list
if: github.event.action == 'labeled'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
id: download-labels
with:
name: labels
Expand All @@ -82,7 +82,7 @@ jobs:
echo "BOARD=${BOARD}" >> $GITHUB_ENV
- name: Add issue to team board
if: ${{ env.BOARD != 'null' && env.BOARD != '' }}
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
uses: actions/add-to-project@main
with:
project-url: ${{ env.BOARD }}
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/zz_generated.check_values_schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl@5.15.0
# devctl@6.23.3
#
name: 'Values and schema'
on:
Expand All @@ -9,16 +9,19 @@ on:
- master
- main
paths:
- 'helm/**/values.yaml'
- 'helm/**/values.schema.json'
- 'helm/**/values.yaml' # default helm chart values
- 'helm/**/values.schema.json' # schema
- 'helm/**/ci/ci-values.yaml' # overrides for CI (can contain required entries)

push: {}

jobs:
check:
name: 'validate values.yaml against values.schema.json'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

Expand All @@ -29,6 +32,22 @@ jobs:
- name: 'Check if values.yaml is a valid instance of values.schema.json'
run: |
HELM_DIR=$(dirname $(git diff --name-only origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF} \
| grep 'helm/[-a-z].*\/values\.' | head -1))
${HOME}/yajsv -s ${HELM_DIR}/values.schema.json ${HELM_DIR}/values.yaml
for chart_yaml in helm/*/Chart.yaml; do
helm_dir="${chart_yaml%/Chart.yaml}"
if [ ! -f ${helm_dir}/values.schema.json ]; then
echo "Skipping validation for '${helm_dir}' folder, because 'values.schema.json' does not exist..."
continue
fi
values=${helm_dir}/values.yaml
if [ -f ${helm_dir}/ci/ci-values.yaml ]; then
# merge ci-values.yaml into values.yaml (providing required values)
echo -e "\nMerged values:\n=============="
yq '. *= load("'${helm_dir}'/ci/ci-values.yaml")' ${helm_dir}/values.yaml | tee ${helm_dir}/combined-values.yaml
echo -e "\n==============\n"
values=${helm_dir}/combined-values.yaml
fi
${HOME}/yajsv -s ${helm_dir}/values.schema.json ${values}
done
Loading

0 comments on commit 9583324

Please sign in to comment.