Skip to content

Commit f7b5d89

Browse files
authored
Switch to ABS, bump architect-orb and remove PSP support (#1310)
1 parent c899b4c commit f7b5d89

File tree

15 files changed

+70
-105
lines changed

15 files changed

+70
-105
lines changed

.abs/main.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
replace-app-version-with-git: true
2+
replace-chart-version-with-git: true
3+
generate-metadata: true
4+
chart-dir: ./helm/app-operator
5+
destination: ./build
6+
7+
# CI overwrites this, check .circleci/config.yaml
8+
catalog-base-url: https://giantswarm.github.io/control-plane-catalog/

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2.1
22
orbs:
3-
architect: giantswarm/architect@5.9.0
3+
architect: giantswarm/architect@5.11.1
44

55
workflows:
66
build:
@@ -28,6 +28,7 @@ workflows:
2828
- master
2929
- architect/push-to-app-catalog:
3030
context: architect
31+
executor: app-build-suite
3132
name: push-app-operator-to-control-plane-app-catalog
3233
app_catalog: control-plane-catalog
3334
app_catalog_test: control-plane-test-catalog

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s
77

88
## [Unreleased]
99

10+
### Removed
11+
12+
- Removed PSP support and thus support for pre v1.25 Kubernetes clusters.
13+
- Removed `.global.podSecurityStandards.enforced` Helm value.
14+
- Removed `.project.branch` and `project.commit` Helm values.
15+
16+
### Changed
17+
18+
- Bump `architect-orb` to `v5.11.1`.
19+
- Updated build pipeline to use `app-build-suite`.
20+
- Changed value for `application.giantswarm.io/branch` label to point to `.Chart.AppVersion` instead as ABS does not support mangling the templates anymore.
21+
- Changed value for `application.giantswarm.io/commit` label to point to `.Chart.AppVersion` instead as ABS does not support mangling the templates anymore.
22+
- Defaulted `.image.tag` to be an empty string and default that to `.Chart.AppVersion` in the deployment.
23+
- Bumped `chart-operator` version to `v3.3.0` in integration tests.
24+
- Bumped `test-app` version to `v1.0.0` in integration tests.
25+
26+
### Added
27+
28+
- Added `ignore-check.kube-linter.io/no-read-only-root-fs` annotation to the deployment to inform `kubelinter` and describe why the write access to the root FS is needed.
29+
1030
## [6.11.2] - 2024-10-22
1131

1232
## [6.11.1] - 2024-10-08

helm/app-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v1
22
description: A Helm chart for the app-operator
33
home: https://github.com/giantswarm/app-operator
44
name: app-operator
5-
appVersion: [[ .AppVersion ]]
6-
version: [[ .Version ]]
5+
appVersion: 6.11.3-dev
6+
version: 6.11.3-dev
77
icon: https://s.giantswarm.io/app-icons/giantswarm/1/dark.svg
88
annotations:
99
application.giantswarm.io/team: "honeybadger"

helm/app-operator/templates/_helpers.tpl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Common labels
1919
{{- define "labels.common" -}}
2020
app: {{ include "name" . | quote }}
2121
{{ include "labels.selector" . }}
22-
application.giantswarm.io/branch: {{ .Values.project.branch | replace "#" "-" | replace "/" "-" | replace "." "-" | trunc 63 | trimSuffix "-" | quote }}
23-
application.giantswarm.io/commit: {{ .Values.project.commit | quote }}
22+
application.giantswarm.io/branch: {{ .Chart.AppVersion | replace "#" "-" | replace "/" "-" | replace "." "-" | trunc 63 | trimSuffix "-" | quote }}
23+
application.giantswarm.io/commit: {{ .Chart.AppVersion | quote }}
2424
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
2525
app.kubernetes.io/version: {{ include "resource.app.version" . | quote }}
2626
application.giantswarm.io/team: {{ index .Chart.Annotations "application.giantswarm.io/team" | quote }}
@@ -34,3 +34,14 @@ Selector labels
3434
app.kubernetes.io/name: {{ include "name" . | quote }}
3535
app.kubernetes.io/instance: {{ .Release.Name | quote }}
3636
{{- end -}}
37+
38+
{{/*
39+
Define image tag.
40+
*/}}
41+
{{- define "image.tag" -}}
42+
{{- if .Values.image.tag }}
43+
{{- .Values.image.tag }}
44+
{{- else }}
45+
{{- .Chart.AppVersion }}
46+
{{- end }}
47+
{{- end }}

helm/app-operator/templates/deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ metadata:
55
namespace: {{ include "resource.default.namespace" . }}
66
labels:
77
{{- include "labels.common" . | nindent 4 }}
8+
annotations:
9+
ignore-check.kube-linter.io/no-read-only-root-fs: "This deployment needs write access to root file system to download artifacts."
810
spec:
911
selector:
1012
matchLabels:
@@ -49,7 +51,7 @@ spec:
4951
{{- end }}
5052
containers:
5153
- name: {{ include "name" . }}
52-
image: "{{ .Values.registry.domain }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
54+
image: "{{ .Values.registry.domain }}/{{ .Values.image.repository }}:{{ include "image.tag" . }}"
5355
volumeMounts:
5456
- name: {{ include "name" . }}-configmap
5557
mountPath: /var/run/{{ include "name" . }}/configmap/

helm/app-operator/templates/psp.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

helm/app-operator/templates/rbac.yaml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -230,36 +230,3 @@ roleRef:
230230
kind: Role
231231
name: {{ include "resource.default.name" . }}-catalog
232232
apiGroup: rbac.authorization.k8s.io
233-
---
234-
{{- if not (((.Values.global).podSecurityStandards).enforced) }}
235-
apiVersion: rbac.authorization.k8s.io/v1
236-
kind: ClusterRole
237-
metadata:
238-
name: {{ include "resource.psp.name" . }}
239-
labels:
240-
{{- include "labels.common" . | nindent 4 }}
241-
rules:
242-
- apiGroups:
243-
- policy
244-
resources:
245-
- podsecuritypolicies
246-
verbs:
247-
- use
248-
resourceNames:
249-
- {{ include "resource.psp.name" . }}
250-
---
251-
apiVersion: rbac.authorization.k8s.io/v1
252-
kind: ClusterRoleBinding
253-
metadata:
254-
name: {{ include "resource.psp.name" . }}
255-
labels:
256-
{{- include "labels.common" . | nindent 4 }}
257-
subjects:
258-
- kind: ServiceAccount
259-
name: {{ include "resource.default.name" . }}
260-
namespace: {{ include "resource.default.namespace" . }}
261-
roleRef:
262-
kind: ClusterRole
263-
name: {{ include "resource.psp.name" . }}
264-
apiGroup: rbac.authorization.k8s.io
265-
{{- end }}

helm/app-operator/values.schema.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,6 @@
8686
}
8787
}
8888
},
89-
"global": {
90-
"type": "object",
91-
"properties": {
92-
"podSecurityStandards": {
93-
"type": "object",
94-
"properties": {
95-
"enforced": {
96-
"type": "boolean"
97-
}
98-
}
99-
}
100-
}
101-
},
10289
"groupID": {
10390
"type": "integer"
10491
},

helm/app-operator/values.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,11 @@ registry:
3232

3333
image:
3434
repository: giantswarm/app-operator
35-
tag: "[[ .Version ]]"
35+
tag: ""
3636

3737
operatorkit:
3838
resyncPeriod: "5m"
3939

40-
project:
41-
branch: "[[ .Branch ]]"
42-
commit: "[[ .SHA ]]"
43-
4440
deployment:
4541
management:
4642
requests:
@@ -97,9 +93,5 @@ serviceMonitor:
9793
# -- (duration) Prometheus scrape timeout.
9894
scrapeTimeout: "45s"
9995

100-
global:
101-
podSecurityStandards:
102-
enforced: false
103-
10496
kyvernoPolicyExceptions:
10597
enabled: true

integration/key/key.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func ChartOperatorUniqueName() string {
4444
}
4545

4646
func ChartOperatorVersion() string {
47-
return "2.24.0"
47+
return "3.3.0"
4848
}
4949

5050
func ControlPlaneCatalogName() string {
@@ -83,6 +83,14 @@ func TestAppName() string {
8383
return "test-app"
8484
}
8585

86+
func TestAppVersion() string {
87+
return "1.0.0"
88+
}
89+
90+
func TestAppTarballUrl() string {
91+
return fmt.Sprintf("%s/%s-%s.tgz", DefaultCatalogStorageURL(), TestAppName(), TestAppVersion())
92+
}
93+
8694
func UniqueAppVersion() string {
8795
return "0.0.0"
8896
}

integration/templates/chart_operator_values.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ helm:
1313
waitTimeout: "180s"
1414
1515
registry:
16-
domain: "quay.io"`
16+
domain: "quay.io"
17+
18+
global:
19+
podSecurityStandards:
20+
enforced: true
21+
`

integration/test/app/basic/basic_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func TestAppLifecycle(t *testing.T) {
101101
CatalogName: key.DefaultCatalogName(),
102102
Name: key.TestAppName(),
103103
Namespace: key.GiantSwarmNamespace(),
104-
Version: "0.1.0",
104+
Version: key.TestAppVersion(),
105105
WaitForDeploy: true,
106106
},
107107
}
@@ -114,7 +114,7 @@ func TestAppLifecycle(t *testing.T) {
114114
{
115115
config.Logger.Debugf(ctx, "checking tarball URL in chart spec")
116116

117-
tarballURL := "https://giantswarm.github.io/default-catalog/test-app-0.1.0.tgz"
117+
tarballURL := key.TestAppTarballUrl()
118118
err = config.K8sClients.CtrlClient().Get(
119119
ctx,
120120
types.NamespacedName{Name: key.TestAppName(), Namespace: key.GiantSwarmNamespace()},
@@ -157,7 +157,7 @@ func TestAppLifecycle(t *testing.T) {
157157
{
158158
config.Logger.Debugf(ctx, "checking tarball URL in chart spec")
159159

160-
err = config.Release.WaitForReleaseVersion(ctx, key.GiantSwarmNamespace(), key.TestAppName(), "0.1.1")
160+
err = config.Release.WaitForReleaseVersion(ctx, key.GiantSwarmNamespace(), key.TestAppName(), key.TestAppVersion())
161161
if err != nil {
162162
t.Fatalf("expected %#v got %#v", nil, err)
163163
}
@@ -171,7 +171,7 @@ func TestAppLifecycle(t *testing.T) {
171171
t.Fatalf("expected %#v got %#v", nil, err)
172172
}
173173

174-
tarballURL := "https://giantswarm.github.io/default-catalog/test-app-0.1.1.tgz"
174+
tarballURL := key.TestAppTarballUrl()
175175
if chart.Spec.TarballURL != tarballURL {
176176
t.Fatalf("expected tarballURL: %#v got %#v", tarballURL, chart.Spec.TarballURL)
177177
}

integration/test/app/workload/workload_cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestWorkloadCluster(t *testing.T) {
123123
KubeConfig: kubeConfig,
124124
Name: key.TestAppName(),
125125
Namespace: metav1.NamespaceDefault,
126-
Version: "0.1.0",
126+
Version: key.TestAppVersion(),
127127
WaitForDeploy: true,
128128
},
129129
}

integration/test/watcher/configmap/configmap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestWatchingConfigMap(t *testing.T) {
146146
Namespace: key.GiantSwarmNamespace(),
147147
},
148148
},
149-
Version: "0.1.0",
149+
Version: key.TestAppVersion(),
150150
},
151151
}
152152

0 commit comments

Comments
 (0)