-
Notifications
You must be signed in to change notification settings - Fork 615
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 and support StringData secrets
If implemented, flux diff kustomization will managed correctly sops managed dockerconfigjson secrets. Sops encrypted secret with stringData maps are supported too. Signed-off-by: Soule BA <[email protected]>
- Loading branch information
Showing
19 changed files
with
281 additions
and
24 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
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
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: secret-basic-auth-stringdata | ||
type: kubernetes.io/basic-auth | ||
stringData: | ||
username: ENC[AES256_GCM,data:uKiQR48=,iv:jh2lgyAVu7igJAgoJsnOGhjxFyvUAa9lvT21u3hhqpU=,tag:zXM2JEpk3ZEH7WfkcWXXkw==,type:str] | ||
password: ENC[AES256_GCM,data:PyhZmNhy929JGQ==,iv:PBqPaJmSw21+kn4gIlg5VdjLNZyf613z5RUTCesBoVw=,tag:Hjc7DsuUrtsz7PYPdNkL3g==,type:str] | ||
sops: | ||
kms: [] | ||
gcp_kms: [] | ||
azure_kv: [] | ||
hc_vault: [] | ||
age: | ||
- recipient: age10la2ge0wtvx3qr7datqf7rs4yngxszdal927fs9rukamr8u2pshsvtz7ce | ||
enc: | | ||
-----BEGIN AGE ENCRYPTED FILE----- | ||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJd0xxbDZhYjVoZzY4YWhK | ||
d2NvMVgrSGRVUGhHRGg3R1FpVURnbmh1TDBzCjcwby85M3JaK09QVk0yZFNMb2NL | ||
c2NQZW5hS1FhYlBHU0VoUzBVYzZYUUUKLS0tIEdaNEw2Y0VjVHpZc3pyYUtLVmJk | ||
NmN3K2VLU0NiZ1d0VHBYbGlCM1lrNmMKeWz3yfFbMNE+ly21oLfc1XnDSPRmnlPP | ||
wIs8lk/qrzVZ45C9GdWnnPeGZZiia46Yop9TxseUS8gCjJ6KCxJCAg== | ||
-----END AGE ENCRYPTED FILE----- | ||
lastmodified: "2022-02-06T12:51:07Z" | ||
mac: ENC[AES256_GCM,data:jtdzwj19uxdxvnmXg1HkAkDA6XlKMJOYFy7uLI5t/t11LwGop5Yeo7a4nQEEELehRx9J7B6U6NiySxAxBxWx5uW5vI5c8+069VV6dkiCIefnYSzuoIhQafjlFl1/KvH7VEjIWfHYuXF09v9PEKXkxEHUYDpS3QqQ3ymHRRI08pU=, iv:xX3E7F+AM29Pm8G5oqxRfYu9E7tEBGIaHeCJYgrtFmc=,tag:MJPGusNvu05z939jg8PAwQ==,type:str] | ||
pgp: [] | ||
encrypted_regex: ^(data|stringData)$ | ||
version: 3.7.1 |
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 |
6 changes: 6 additions & 0 deletions
6
cmd/flux/testdata/diff-kustomization/diff-with-stringdata-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/docker-secret created | ||
► Secret/default/podinfo-token-77t89m9b67 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 |
12 changes: 12 additions & 0 deletions
12
cmd/flux/testdata/diff-kustomization/stringdata-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,12 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
kustomize.toolkit.fluxcd.io/name: podinfo | ||
kustomize.toolkit.fluxcd.io/namespace: {{ .fluxns }} | ||
name: secret-basic-auth-stringdata | ||
namespace: default | ||
stringData: | ||
password: KipTT1BTKio= | ||
username: KipTT1BTKio= | ||
type: kubernetes.io/basic-auth |
Oops, something went wrong.