-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Adding unittests for secret functions
Signed-off-by: Pete Wall <pete.wall@grafana.com>
- Loading branch information
Showing
20 changed files
with
93 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
Binary file modified
BIN
+0 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-annotation-autodiscovery-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-application-observability-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-events-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+67 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-cluster-metrics-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-pod-logs-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-profiling-1.0.0.tgz
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
charts/k8s-monitoring/charts/k8s-monitoring-feature-prometheus-operator-objects-1.0.0.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions
1
charts/k8s-monitoring/docs/examples/auth/embedded-secrets/alloy-logs.alloy
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
charts/k8s-monitoring/docs/examples/auth/embedded-secrets/alloy-metrics.alloy
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
charts/k8s-monitoring/docs/examples/auth/embedded-secrets/alloy-receiver.alloy
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
charts/k8s-monitoring/docs/examples/auth/embedded-secrets/output.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,29 @@ | ||
{{- if eq .Values.testing "true" }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-secrets-authType | ||
data: | ||
testEmpty: {{ include "secrets.authType" dict | quote }} | ||
testEmptyAuth: {{ include "secrets.authType" (dict "auth" (dict)) | quote }} | ||
testEmptyType: {{ include "secrets.authType" (dict "auth" (dict "type" "")) | quote }} | ||
testAuthTypeBasic: {{ include "secrets.authType" (dict "auth" (dict "type" "basic")) | quote }} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test-secrets-secretType | ||
data: | ||
testEmpty: {{ include "secrets.secretType" dict | quote }} | ||
testEmptySecret: {{ include "secrets.secretType" (dict "secret" (dict)) | quote }} | ||
testEmbeddedTrue: {{ include "secrets.secretType" (dict "secret" (dict "embed" true)) | quote }} | ||
testEmbeddedFalse: {{ include "secrets.secretType" (dict "secret" (dict "embed" false)) | quote }} | ||
testCreateTrue: {{ include "secrets.secretType" (dict "secret" (dict "create" true)) | quote }} | ||
testCreateFalse: {{ include "secrets.secretType" (dict "secret" (dict "create" false)) | quote }} | ||
testBothTrue: {{ include "secrets.secretType" (dict "secret" (dict "create" true "embed" true)) | quote }} | ||
testBothFalse: {{ include "secrets.secretType" (dict "secret" (dict "create" false "embed" false)) | quote }} | ||
testCreateTrueEmbedFalse: {{ include "secrets.secretType" (dict "secret" (dict "create" true "embed" false)) | quote }} | ||
testCreateFalseEmbedTrue: {{ include "secrets.secretType" (dict "secret" (dict "create" false "embed" true)) | 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces | ||
suite: Secret functions unit tests | ||
templates: | ||
- test/secrets.yaml | ||
tests: | ||
- it: secrets.authType works appropriately | ||
set: | ||
testing: "true" | ||
asserts: | ||
- {equal: {path: "data.testEmpty", value: "none" }, documentIndex: 0 } | ||
- {equal: {path: "data.testEmptyAuth", value: "none" }, documentIndex: 0 } | ||
- {equal: {path: "data.testEmptyType", value: "none" }, documentIndex: 0 } | ||
- {equal: {path: "data.testAuthTypeBasic", value: "basic" }, documentIndex: 0 } | ||
|
||
- it: secrets.secretType works appropriately | ||
set: | ||
testing: "true" | ||
asserts: | ||
- {equal: {path: "data.testEmpty", value: "create" }, documentIndex: 1 } | ||
- {equal: {path: "data.testEmptySecret", value: "create" }, documentIndex: 1 } | ||
- {equal: {path: "data.testEmbeddedTrue", value: "embedded" }, documentIndex: 1 } | ||
- {equal: {path: "data.testEmbeddedFalse", value: "create" }, documentIndex: 1 } | ||
- {equal: {path: "data.testCreateTrue", value: "create" }, documentIndex: 1 } | ||
- {equal: {path: "data.testCreateFalse", value: "external" }, documentIndex: 1 } | ||
- {equal: {path: "data.testBothTrue", value: "embedded" }, documentIndex: 1 } | ||
- {equal: {path: "data.testBothFalse", value: "external" }, documentIndex: 1 } | ||
- {equal: {path: "data.testCreateTrueEmbedFalse", value: "create" }, documentIndex: 1 } | ||
- {equal: {path: "data.testCreateFalseEmbedTrue", value: "embedded" }, documentIndex: 1 } | ||
|