Support for ignoring specific Resources via annotation.

Resources annotated with `config.kubernetes.io/local-config` will be ignored by Kustomize
This commit is contained in:
Phillip Wittrock
2019-10-29 16:41:45 -07:00
parent f2368201d9
commit 8bf98dd255
2 changed files with 38 additions and 1 deletions

View File

@@ -105,6 +105,25 @@ metadata:
expectedOut: []ifc.Kunstructured{testConfigMap, testConfigMap},
expectedErr: false,
},
{
name: "localConfigYaml",
input: []byte(`
apiVersion: v1
kind: ConfigMap
metadata:
name: winnie-skip
annotations:
# this annotation causes the Resource to be ignored by kustomize
config.kubernetes.io/local-config: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: winnie
`),
expectedOut: []ifc.Kunstructured{testConfigMap},
expectedErr: false,
},
{
name: "garbageInOneOfTwoObjects",
input: []byte(`