-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dsb-spring-boot): support Azure Workload Identity annotations
- Loading branch information
Showing
6 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Release.Name }}-service-account | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ .Release.Name }}-app | ||
{{- if empty .Values.azureWorkloadIdentity.clientId | not }} | ||
annotations: | ||
azure.workload.identity/client-id: {{ .Values.azureWorkloadIdentity.clientId | quote }} | ||
{{- end }} | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
suite: test workload identity (wi) config | ||
tests: | ||
- it: wi should be disabled by default | ||
template: deployment.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.metadata.labels["azure.workload.identity/use"] | ||
value: "false" | ||
- it: it should be possible to enable wi by specifying a client id | ||
template: deployment.yaml | ||
set: | ||
azureWorkloadIdentity: | ||
clientId: "test-client-id" | ||
asserts: | ||
- equal: | ||
path: spec.template.metadata.labels["azure.workload.identity/use"] | ||
value: "true" | ||
- it: empty wi client id should result in wi being disabled | ||
template: deployment.yaml | ||
set: | ||
azureWorkloadIdentity: | ||
clientId: "" | ||
asserts: | ||
- equal: | ||
path: spec.template.metadata.labels["azure.workload.identity/use"] | ||
value: "false" | ||
- it: when wi is enabled, the client id should exist as service account annotation | ||
template: serviceAccount.yaml | ||
set: | ||
azureWorkloadIdentity: | ||
clientId: "test-client-id" | ||
asserts: | ||
- equal: | ||
path: metadata.annotations["azure.workload.identity/client-id"] | ||
value: "test-client-id" | ||
- it: when wi is disabled, the client id should not exist as service account annotation | ||
template: serviceAccount.yaml | ||
asserts: | ||
- notExists: | ||
path: metadata.annotations["azure.workload.identity/client-id"] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters