-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mask dockerconfigjson secret types with a json object
If implemented, flux diff kustomization will managed correctly sops managed dockerconfigjson secrets. A secret containing stringData has been added to the test cases as well. Signed-off-by: Soule BA <[email protected]>
- Loading branch information
Showing
15 changed files
with
160 additions
and
19 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
27 changes: 27 additions & 0 deletions
27
cmd/flux/testdata/build-kustomization/podinfo/dockerconfigjson-sops-secret.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,27 @@ | ||
apiVersion: v1 | ||
data: | ||
.dockerconfigjson: ENC[AES256_GCM,data:KHCFH3hNnc+PMfWLFEPjebf3W4z4WXbGFAANRZyZC+07z7wlrTALJM6rn8YslW4tMAWCoAYxblC5WRCszTy0h9rw0U/RGOv5H0qCgnNg/FILFUqhwo9pNfrUH+MEP4M9qxxbLKZwObpHUE7DUsKx1JYAxsI=,iv:q48lqUbUQD+0cbYcjNMZMJLRdGHi78ZmDhNAT2th9tg=,tag:QRI2SZZXQrAcdql3R5AH2g==,type:str] | ||
kind: Secret | ||
metadata: | ||
name: docker-secret | ||
type: kubernetes.io/dockerconfigjson | ||
sops: | ||
kms: [] | ||
gcp_kms: [] | ||
azure_kv: [] | ||
hc_vault: [] | ||
age: | ||
- recipient: age10la2ge0wtvx3qr7datqf7rs4yngxszdal927fs9rukamr8u2pshsvtz7ce | ||
enc: | | ||
-----BEGIN AGE ENCRYPTED FILE----- | ||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3eU1CTEJhVXZ4eEVYYkVV | ||
OU90TEcrR2pYckttN0pBanJoSUZWSW1RQXlRCkUydFJ3V1NZUTBuVFF0aC9GUEcw | ||
bUdhNjJWTkoyL1FUVi9Dc1dxUDBkM0UKLS0tIE1sQXkwcWdGaEFuY0RHQTVXM0J6 | ||
dWpJcThEbW15V3dXYXpPZklBdW1Hd1kKoIAdmGNPrEctV8h1w8KuvQ5S+BGmgqN9 | ||
MgpNmUhJjWhgcQpb5BRYpQesBOgU5TBGK7j58A6DMDKlSiYZsdQchQ== | ||
-----END AGE ENCRYPTED FILE----- | ||
lastmodified: "2022-02-03T16:03:17Z" | ||
mac: ENC[AES256_GCM,data:AHdYSawajwgAFwlmDN1IPNmT9vWaYKzyVIra2d6sPcjTbZ8/p+VRSRpVm4XZFFsaNnW5AUJaouwXnKYDTmJDXKlr/rQcu9kXqsssQgdzcXaA6l5uJlgsnml8ba7J3OK+iEKMax23mwQEx2EUskCd9ENOwFDkunP02sxqDNOz20k=,iv:8F5OamHt3fAVorf6p+SoIrWoqkcATSGWVoM0EK87S4M=,tag:E1mxXnc7wWkEX5BxhpLtng==,type:str] | ||
pgp: [] | ||
encrypted_regex: ^(data|stringData)$ | ||
version: 3.7.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
8 changes: 8 additions & 0 deletions
8
cmd/flux/testdata/build-kustomization/podinfo/stringdata-secret.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,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: secret-basic-auth-stringdata | ||
type: kubernetes.io/basic-auth | ||
stringData: | ||
username: admin | ||
password: t0p-Secret |
2 changes: 2 additions & 0 deletions
2
cmd/flux/testdata/diff-kustomization/diff-with-deployment.golden
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,4 +1,6 @@ | ||
► HorizontalPodAutoscaler/default/podinfo created | ||
► Service/default/podinfo created | ||
► Secret/default/docker-secret created | ||
► Secret/default/secret-basic-auth-stringdata created | ||
► Secret/default/podinfo-token-77t89m9b67 created | ||
► Secret/default/db-user-pass-bkbd782d2c created |
6 changes: 6 additions & 0 deletions
6
cmd/flux/testdata/diff-kustomization/diff-with-dockerconfigjson-sops-secret.golden
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,6 @@ | ||
► Deployment/default/podinfo created | ||
► HorizontalPodAutoscaler/default/podinfo created | ||
► Service/default/podinfo created | ||
► Secret/default/secret-basic-auth-stringdata created | ||
► Secret/default/podinfo-token-77t89m9b67 created | ||
► Secret/default/db-user-pass-bkbd782d2c created |
2 changes: 2 additions & 0 deletions
2
cmd/flux/testdata/diff-kustomization/diff-with-drifted-key-sops-secret.golden
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
2 changes: 2 additions & 0 deletions
2
cmd/flux/testdata/diff-kustomization/diff-with-drifted-secret.golden
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
2 changes: 2 additions & 0 deletions
2
cmd/flux/testdata/diff-kustomization/diff-with-drifted-value-sops-secret.golden
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,4 +1,6 @@ | ||
► Deployment/default/podinfo created | ||
► HorizontalPodAutoscaler/default/podinfo created | ||
► Service/default/podinfo created | ||
► Secret/default/docker-secret created | ||
► Secret/default/secret-basic-auth-stringdata created | ||
► Secret/default/db-user-pass-bkbd782d2c created |
11 changes: 11 additions & 0 deletions
11
cmd/flux/testdata/diff-kustomization/dockerconfigjson-sops-secret.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,11 @@ | ||
apiVersion: v1 | ||
data: | ||
.dockerconfigjson: eyJtYXNrIjoiKipTT1BTKioifQ== | ||
kind: Secret | ||
metadata: | ||
labels: | ||
kustomize.toolkit.fluxcd.io/name: podinfo | ||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }} | ||
name: docker-secret | ||
namespace: default | ||
type: kubernetes.io/dockerconfigjson |
2 changes: 2 additions & 0 deletions
2
cmd/flux/testdata/diff-kustomization/nothing-is-deployed.golden
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,7 @@ | ||
► Deployment/default/podinfo created | ||
► HorizontalPodAutoscaler/default/podinfo created | ||
► Service/default/podinfo created | ||
► Secret/default/docker-secret created | ||
► Secret/default/secret-basic-auth-stringdata created | ||
► Secret/default/podinfo-token-77t89m9b67 created | ||
► Secret/default/db-user-pass-bkbd782d2c created |
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