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

feat(labels): add part-of selector label #211

Merged
merged 3 commits into from
Nov 21, 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
1 change: 1 addition & 0 deletions charts/cryostat/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Selector labels.
{{- define "cryostat.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cryostat.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: cryostat
{{- end }}

{{/*
Expand Down
6 changes: 4 additions & 2 deletions charts/cryostat/templates/cryostat_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ spec:
- port: {{ .Values.core.service.httpPort }}
targetPort: 4180
protocol: TCP
name: cryostat-http
name: http
appProtocol: http
{{- if (.Values.authentication.openshift).enabled }}
- port: 443
targetPort: 8443
protocol: TCP
name: cryostat-https
name: https
appProtocol: https
{{- end }}
selector:
{{- include "cryostat.selectorLabels" $ | nindent 4 }}
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/cookie_secret_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: 4.0.0-dev
Expand Down
3 changes: 3 additions & 0 deletions charts/cryostat/tests/cryostat_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.spec.serviceAccountName
value: RELEASE-NAME-cryostat
Expand All @@ -47,6 +49,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat

- it: should validate all container settings including environment variables and security contexts
asserts:
Expand Down
15 changes: 12 additions & 3 deletions charts/cryostat/tests/cryostat_service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ tests:
value: TCP
- equal:
path: spec.ports[0].name
value: cryostat-http
value: http
- equal:
path: spec.ports[0].appProtocol
value: http
- equal:
path: metadata.labels
value:
Expand All @@ -41,6 +44,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat

- it: should create a Service with the correct settings when OpenShift authentication is enabled
set:
Expand Down Expand Up @@ -68,7 +72,7 @@ tests:
value: TCP
- equal:
path: spec.ports[0].name
value: cryostat-http
value: http
- equal:
path: spec.ports[1].port
value: 443
Expand All @@ -80,13 +84,17 @@ tests:
value: TCP
- equal:
path: spec.ports[1].name
value: cryostat-https
value: https
- equal:
path: spec.ports[1].appProtocol
value: https
- equal:
path: spec.selector
value:
app.kubernetes.io/name: cryostat
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat
- equal:
path: metadata.labels
value:
Expand All @@ -96,6 +104,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: cryostat
app.kubernetes.io/part-of: cryostat
- equal:
path: metadata.annotations
value:
Expand Down
3 changes: 3 additions & 0 deletions charts/cryostat/tests/db_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: db
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: db
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.spec.serviceAccountName
value: RELEASE-NAME-cryostat
Expand All @@ -47,6 +49,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: db
app.kubernetes.io/part-of: cryostat

- it: should validate cryostat-db settings
asserts:
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/db_pvc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: "4.0.0-dev"
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/db_secret_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: 4.0.0-dev
Expand Down
2 changes: 2 additions & 0 deletions charts/cryostat/tests/db_service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: db
app.kubernetes.io/part-of: cryostat

- it: should create a Service with the correct settings overrides
set:
Expand Down Expand Up @@ -57,3 +58,4 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: db
app.kubernetes.io/part-of: cryostat
3 changes: 3 additions & 0 deletions charts/cryostat/tests/reports_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: reports
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/component: reports
- equal:
path: spec.template.spec.serviceAccountName
Expand All @@ -55,6 +57,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: reports
app.kubernetes.io/part-of: cryostat

- it: should validate all container settings including environment variables and security contexts
set:
Expand Down
2 changes: 2 additions & 0 deletions charts/cryostat/tests/role_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: "4.0.0-dev"
Expand All @@ -45,6 +46,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: "4.0.0-dev"
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/route_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: "4.0.0-dev"
Expand Down
3 changes: 3 additions & 0 deletions charts/cryostat/tests/storage_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: cryostat
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: cryostat
- equal:
path: spec.template.spec.serviceAccountName
value: RELEASE-NAME-cryostat
Expand All @@ -47,6 +49,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: cryostat

- it: should validate cryostat-storage settings
asserts:
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/storage_pvc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: "4.0.0-dev"
Expand Down
1 change: 1 addition & 0 deletions charts/cryostat/tests/storage_secret_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tests:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/part-of: cryostat
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: cryostat
app.kubernetes.io/version: 4.0.0-dev
Expand Down
2 changes: 2 additions & 0 deletions charts/cryostat/tests/storage_service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: cryostat

- it: should create a Service with the correct settings overrides
set:
Expand Down Expand Up @@ -58,3 +59,4 @@ tests:
app.kubernetes.io/version: "4.0.0-dev"
helm.sh/chart: cryostat-2.0.0-dev
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: cryostat
Loading