-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(generic): configure ServiceAccount when name is set or creation i…
…s enabled (#344)
- Loading branch information
1 parent
081c089
commit 4821a8a
Showing
11 changed files
with
78 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "pre-commit" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Setup for pre-commit | ||
run: make install | ||
|
||
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SHELL := /bin/bash -o pipefail -o errexit | ||
|
||
install: | ||
helm plugin install https://github.com/helm-unittest/helm-unittest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
suite: test ServiceAccount | ||
templates: | ||
- templates/deployment.yaml | ||
release: | ||
name: test-release | ||
namespace: test-namespace | ||
tests: | ||
- it: "verifies that the default configuration sets the ServiceAccount name" | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.serviceAccountName | ||
value: test-release-generic | ||
|
||
- it: "verifies that configuring the ServiceAccount name sets it accordingly" | ||
set: | ||
serviceAccount.name: test-sa | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.serviceAccountName | ||
value: test-sa | ||
|
||
- it: "verifies that configuring a ServiceAccount name with create: false still sets ServiceAccount" | ||
set: | ||
serviceAccount.create: false | ||
serviceAccount.name: test-sa | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.serviceAccountName | ||
value: test-sa | ||
|
||
- it: "verifies that not setting a name with create: false does not set a ServiceAccount" | ||
set: | ||
serviceAccount.create: false | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.serviceAccountName |
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,2 @@ | ||
#!/usr/bin/env bash | ||
ls -1 charts | xargs -I {} helm unittest "charts/{}" |
File renamed without changes.