-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #686 from Sathwik-git/main
fix(uplink): Ensure string input for b64enc in secret.yaml
- Loading branch information
Showing
4 changed files
with
68 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
suite: test secret.yaml | ||
templates: | ||
- secret.yaml | ||
tests: | ||
- it: should ensure the secret has correct metadata | ||
set: | ||
postgresql.url: "example-url" | ||
client.id: "example-id" | ||
client.secret: "example-secret" | ||
sentry.dsn: "example-dsn" | ||
asserts: | ||
- isKind: | ||
of: Secret | ||
- matchRegex: | ||
path: metadata.name | ||
pattern: "^uplink.*" # General check to ensure name starts with "uplink" | ||
- equal: | ||
path: metadata.name | ||
value: "RELEASE-NAME-uplink." # Specific check for the exact name | ||
|
||
- it: should check data fields in secret | ||
set: | ||
postgresql.url: "example-url" | ||
client.id: "example-id" | ||
client.secret: "example-secret" | ||
sentry.dsn: "example-dsn" | ||
asserts: | ||
- equal: | ||
path: data.postgresql.url | ||
value: "ZXhhbXBsZS11cmw=" # Base64 encoded value of "example-url" | ||
- equal: | ||
path: data.client.id | ||
value: "ZXhhbXBsZS1pZA==" # Base64 encoded value of "example-id" | ||
- equal: | ||
path: data.client.secret | ||
value: "ZXhhbXBsZS1zZWNyZXQ=" # Base64 encoded value of "example-secret" | ||
- equal: | ||
path: data.sentry.dsn | ||
value: "ZXhhbXBsZS1kc24=" # Base64 encoded value of "example-dsn" | ||
|
||
# Add more tests as required... |
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,25 @@ | ||
suite: test default behavior of secret.yaml with default values | ||
templates: | ||
- secret.yaml | ||
tests: | ||
- it: should render with default values without error | ||
asserts: | ||
- isKind: | ||
of: Secret | ||
- matchRegex: | ||
path: metadata.name | ||
pattern: "^uplink.*" # Assuming the default behavior still starts with "uplink" | ||
- notMatchRegex: | ||
path: data.postgresql.url | ||
pattern: "." # Assuming no default value provided | ||
- notMatchRegex: | ||
path: data.client.id | ||
pattern: "." # Assuming no default value provided | ||
- notMatchRegex: | ||
path: data.client.secret | ||
pattern: "." # Assuming no default value provided | ||
- notMatchRegex: | ||
path: data.sentry.dsn | ||
pattern: "." # Assuming no default value provided | ||
|
||
# Add more tests as required to check default behavior... |