Skip to content

Commit 80b2766

Browse files
committed
[Backport] Add global.podSecurityStandards.enforced value for PSS migration.
1 parent a7fd526 commit 80b2766

16 files changed

+488
-150
lines changed

.circleci/config.yml

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2.1
22
orbs:
3-
architect: giantswarm/architect@4.21.0
3+
architect: giantswarm/architect@5.0.1
44

55
workflows:
66
build:
@@ -13,42 +13,12 @@ workflows:
1313
tags:
1414
only: /^v.*/
1515

16-
- architect/push-to-docker:
17-
context: "architect"
18-
name: push-app-operator-to-docker
19-
image: "docker.io/giantswarm/app-operator"
20-
username_envar: "DOCKER_USERNAME"
21-
password_envar: "DOCKER_PASSWORD"
22-
requires:
23-
- go-build
24-
# Needed to trigger job also on git tag.
25-
filters:
26-
tags:
27-
only: /^v.*/
28-
29-
- architect/push-to-docker:
30-
context: architect
31-
name: push-app-operator-to-quay
32-
image: "quay.io/giantswarm/app-operator"
33-
username_envar: "QUAY_USERNAME"
34-
password_envar: "QUAY_PASSWORD"
35-
requires:
36-
- go-build
37-
filters:
38-
# Trigger the job also on git tag.
39-
tags:
40-
only: /^v.*/
41-
42-
- architect/push-to-docker:
16+
- architect/push-to-registries:
4317
context: architect
44-
name: push-app-operator-to-aliyun
45-
image: "registry-intl.cn-shanghai.aliyuncs.com/giantswarm/app-operator"
46-
username_envar: "ALIYUN_USERNAME"
47-
password_envar: "ALIYUN_PASSWORD"
18+
name: push-to-registries
4819
requires:
4920
- go-build
5021
filters:
51-
# Trigger the job also on git tag.
5222
tags:
5323
only: /^v.*/
5424

@@ -59,14 +29,15 @@ workflows:
5929
app_catalog_test: "control-plane-test-catalog"
6030
chart: "app-operator"
6131
requires:
62-
- push-app-operator-to-quay
32+
- push-to-registries
6333
filters:
6434
tags:
6535
only: /^v.*/
6636

6737
- architect/integration-test:
6838
context: architect
6939
name: basic-integration-test
40+
install-app-platform: false
7041
setup-script: "integration/setup/setup.sh"
7142
test-dir: "integration/test/app/basic"
7243
requires:
@@ -106,8 +77,8 @@ workflows:
10677
app_name: "app-operator"
10778
app_collection_repo: "aws-app-collection"
10879
requires:
109-
- push-app-operator-to-aliyun
11080
- push-app-operator-to-control-plane-app-catalog
81+
- push-to-registries
11182
filters:
11283
branches:
11384
ignore: /.*/
@@ -129,9 +100,9 @@ workflows:
129100

130101
- architect/push-to-app-collection:
131102
context: architect
132-
name: push-app-operator-to-openstack-app-collection
103+
name: push-app-operator-to-vsphere-app-collection
133104
app_name: "app-operator"
134-
app_collection_repo: "openstack-app-collection"
105+
app_collection_repo: "vsphere-app-collection"
135106
requires:
136107
- push-app-operator-to-control-plane-app-catalog
137108
filters:
@@ -140,11 +111,12 @@ workflows:
140111
tags:
141112
only: /^v.*/
142113

114+
143115
- architect/push-to-app-collection:
116+
name: push-to-cloud-director-app-collection
144117
context: architect
145-
name: push-app-operator-to-kvm-app-collection
146118
app_name: "app-operator"
147-
app_collection_repo: "kvm-app-collection"
119+
app_collection_repo: "cloud-director-app-collection"
148120
requires:
149121
- push-app-operator-to-control-plane-app-catalog
150122
filters:
@@ -155,9 +127,35 @@ workflows:
155127

156128
- architect/push-to-app-collection:
157129
context: architect
158-
name: push-app-operator-to-vsphere-app-collection
130+
name: push-to-capa-app-collection
159131
app_name: "app-operator"
160-
app_collection_repo: "vsphere-app-collection"
132+
app_collection_repo: "capa-app-collection"
133+
requires:
134+
- push-app-operator-to-control-plane-app-catalog
135+
filters:
136+
branches:
137+
ignore: /.*/
138+
tags:
139+
only: /^v.*/
140+
141+
- architect/push-to-app-collection:
142+
context: architect
143+
name: push-to-capz-app-collection
144+
app_name: "app-operator"
145+
app_collection_repo: "capz-app-collection"
146+
requires:
147+
- push-app-operator-to-control-plane-app-catalog
148+
filters:
149+
branches:
150+
ignore: /.*/
151+
tags:
152+
only: /^v.*/
153+
154+
- architect/push-to-app-collection:
155+
context: architect
156+
name: push-to-gcp-app-collection
157+
app_name: "app-operator"
158+
app_collection_repo: "gcp-app-collection"
161159
requires:
162160
- push-app-operator-to-control-plane-app-catalog
163161
filters:

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Checklist
2+
3+
- [ ] Update changelog in CHANGELOG.md.

.github/workflows/pre_commit_go.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ name: pre-commit
33
on:
44
pull_request:
55
push:
6-
branches: [master]
6+
branches: [main]
77

88
jobs:
99
pre-commit:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v3
13+
- uses: actions/setup-python@v4
1414
- uses: actions/setup-go@v3
1515
with:
16-
go-version: "1.17.7"
16+
go-version: "1.21"
1717
- name: Install goimports
1818
run: |
1919
go install golang.org/x/tools/cmd/goimports@latest
2020
- name: Install golangci-lint
2121
env:
22-
GOLANGCI_LINT_VERSION: "v1.42.1"
22+
GOLANGCI_LINT_VERSION: "v1.54.2"
2323
run: |
2424
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
2525
sudo sh -s -- -b $GOPATH/bin ${GOLANGCI_LINT_VERSION}
26-
- uses: pre-commit/action@v2.0.3
26+
- uses: pre-commit/action@v3.0.0
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Add appropriate labels to issue
2+
3+
on:
4+
issues:
5+
types: [assigned]
6+
7+
jobs:
8+
build_user_list:
9+
name: Get yaml config of GS users
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get user-mapping
13+
run: |
14+
mkdir -p artifacts
15+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
16+
-O artifacts/users.yaml \
17+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
18+
- name: Upload Artifact
19+
uses: actions/upload-artifact@v4
20+
with:
21+
name: users
22+
path: artifacts/users.yaml
23+
retention-days: 1
24+
25+
add_label:
26+
name: Add team label when assigned
27+
runs-on: ubuntu-latest
28+
needs: build_user_list
29+
steps:
30+
- uses: actions/download-artifact@v4
31+
id: download-users
32+
with:
33+
name: users
34+
- name: Find team label based on user names
35+
run: |
36+
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]')
37+
echo "Issue assigned to: ${event_assignee}"
38+
39+
TEAMS=$(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.teams" -o csv | tr ',' ' ')
40+
41+
echo "LABEL<<EOF" >> $GITHUB_ENV
42+
for team in ${TEAMS}; do
43+
echo "Team: ${team} | Label: team/${team}"
44+
echo "team/${team}" >> $GITHUB_ENV
45+
done
46+
echo "EOF" >> $GITHUB_ENV
47+
- name: Apply label to issue
48+
if: ${{ env.LABEL != '' && env.LABEL != 'null' && env.LABEL != null }}
49+
uses: actions-ecosystem/action-add-labels@v1
50+
with:
51+
github_token: ${{ secrets.ISSUE_AUTOMATION }}
52+
labels: |
53+
${{ env.LABEL }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Add Issue to Project when assigned
2+
3+
on:
4+
issues:
5+
types:
6+
- assigned
7+
- labeled
8+
9+
jobs:
10+
build_user_list:
11+
name: Get yaml config of GS users
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Get user-mapping
15+
run: |
16+
mkdir -p artifacts
17+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
18+
-O artifacts/users.yaml \
19+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
20+
- name: Upload Artifact
21+
uses: actions/upload-artifact@v4
22+
with:
23+
name: users
24+
path: artifacts/users.yaml
25+
retention-days: 1
26+
- name: Get label-mapping
27+
run: |
28+
mkdir -p artifacts
29+
wget --header "Authorization: token ${{ secrets.ISSUE_AUTOMATION }}" \
30+
-O artifacts/labels.yaml \
31+
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/label-mapping.yaml
32+
- name: Upload Artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: labels
36+
path: artifacts/labels.yaml
37+
retention-days: 1
38+
39+
add_to_personal_board:
40+
name: Add issue to personal board
41+
runs-on: ubuntu-latest
42+
needs: build_user_list
43+
if: github.event.action == 'assigned'
44+
steps:
45+
- uses: actions/download-artifact@v4
46+
id: download-users
47+
with:
48+
name: users
49+
- name: Find personal board based on user names
50+
run: |
51+
event_assignee=$(cat $GITHUB_EVENT_PATH | jq -r .assignee.login | tr '[:upper:]' '[:lower:]')
52+
echo "Issue assigned to: ${event_assignee}"
53+
54+
BOARD=($(cat ${{steps.download-users.outputs.download-path}}/users.yaml | tr '[:upper:]' '[:lower:]' | yq ".${event_assignee}.personalboard"))
55+
echo "Personal board URL: ${BOARD}"
56+
57+
echo "BOARD=${BOARD}" >> $GITHUB_ENV
58+
- name: Add issue to personal board
59+
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
60+
uses: actions/add-to-project@main
61+
with:
62+
project-url: ${{ env.BOARD }}
63+
github-token: ${{ secrets.ISSUE_AUTOMATION }}
64+
65+
add_to_team_board:
66+
name: Add issue to team board
67+
runs-on: ubuntu-latest
68+
needs: build_user_list
69+
if: github.event.action == 'labeled'
70+
steps:
71+
- uses: actions/download-artifact@v4
72+
id: download-labels
73+
with:
74+
name: labels
75+
- name: Find team board based on label
76+
run: |
77+
event_label=$(cat $GITHUB_EVENT_PATH | jq -r .label.name | tr '[:upper:]' '[:lower:]')
78+
echo "Issue labelled with: ${event_label}"
79+
80+
BOARD=($(cat ${{steps.download-labels.outputs.download-path}}/labels.yaml | tr '[:upper:]' '[:lower:]' | yq ".[\"${event_label}\"].projectboard"))
81+
echo "Team board URL: ${BOARD}"
82+
83+
echo "BOARD=${BOARD}" >> $GITHUB_ENV
84+
- name: Add issue to team board
85+
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
86+
uses: actions/add-to-project@main
87+
with:
88+
project-url: ${{ env.BOARD }}
89+
github-token: ${{ secrets.ISSUE_AUTOMATION }}

0 commit comments

Comments
 (0)