-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
153 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
apiVersion: v2 | ||
name: snyk-broker | ||
version: 2.7.1 | ||
version: 2.7.2 | ||
description: A Helm chart for Kubernetes | ||
type: application |
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
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
121 changes: 121 additions & 0 deletions
121
charts/snyk-broker/tests/broker_deployment_service_account_test.yaml
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,121 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json | ||
suite: test broker service account | ||
chart: | ||
version: 0.0.0 | ||
templates: | ||
- &brokerDep broker_deployment.yaml | ||
- &craDep cra_deployment.yaml | ||
- &caDep code_agent_deployment.yaml | ||
- &sa serviceaccount.yaml | ||
values: | ||
- ../values.yaml | ||
- ./fixtures/default_values.yaml | ||
set: | ||
enableCodeAgent: true | ||
scmType: container-registry-agent | ||
|
||
tests: | ||
- it: uses the generated service account | ||
asserts: | ||
- equal: | ||
path: &serviceAccountNamePath spec.template.spec.serviceAccountName | ||
value: &defaultServiceAccountName snyk-broker-RELEASE-NAME | ||
template: *brokerDep | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *defaultServiceAccountName | ||
template: *craDep | ||
documentIndex: 0 | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *defaultServiceAccountName | ||
template: *caDep | ||
documentIndex: 0 | ||
- equal: | ||
path: metadata.name | ||
value: *defaultServiceAccountName | ||
template: *sa | ||
- it: creates a serviceaccount with specified name | ||
set: | ||
serviceAccount.name: "my-custom-service-account-name" | ||
asserts: | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: &myCustomServiceAccountName my-custom-service-account-name-RELEASE-NAME | ||
template: *brokerDep | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *myCustomServiceAccountName | ||
template: *craDep | ||
documentIndex: 0 | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *myCustomServiceAccountName | ||
template: *caDep | ||
documentIndex: 0 | ||
- equal: | ||
path: metadata.name | ||
value: *myCustomServiceAccountName | ||
template: *sa | ||
- it: falls back to the `default` service account if name is empty | ||
set: | ||
serviceAccount.create: false | ||
serviceAccount.name: "" | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
template: *sa | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: &defaultServiceAccount default | ||
template: *brokerDep | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *defaultServiceAccount | ||
template: *craDep | ||
documentIndex: 0 | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *defaultServiceAccount | ||
template: *caDep | ||
documentIndex: 0 | ||
- it: uses an external service account | ||
set: | ||
serviceAccount.create: false | ||
serviceAccount.name: "my-external-service-account" | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
template: *sa | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: &myExternalServiceAccount my-external-service-account | ||
template: *brokerDep | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *myExternalServiceAccount | ||
template: *craDep | ||
documentIndex: 0 | ||
- equal: | ||
path: *serviceAccountNamePath | ||
value: *myExternalServiceAccount | ||
template: *caDep | ||
documentIndex: 0 | ||
- it: does not use or generate a service account | ||
set: | ||
serviceAccount.enabled: false | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
template: *sa | ||
- notExists: | ||
path: *serviceAccountNamePath | ||
template: *brokerDep | ||
- notExists: | ||
path: *serviceAccountNamePath | ||
template: *craDep | ||
documentIndex: 0 | ||
- notExists: | ||
path: *serviceAccountNamePath | ||
template: *caDep | ||
documentIndex: 0 |
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