Support custom config for image transformer

This commit is contained in:
Yujun Zhang
2019-03-09 12:04:18 +08:00
parent 3e85c4589b
commit f311ba8d4f
4 changed files with 26 additions and 61 deletions

View File

@@ -31,7 +31,7 @@ func GetDefaultFieldSpecs() []byte {
[]byte(namespaceFieldSpecs),
[]byte(varReferenceFieldSpecs),
[]byte(nameReferenceFieldSpecs),
[]byte(imageFieldSpecs),
[]byte(imagesFieldSpecs),
}
return bytes.Join(configData, []byte("\n"))
}
@@ -46,6 +46,6 @@ func GetDefaultFieldSpecsAsMap() map[string]string {
result["namespace"] = namespaceFieldSpecs
result["varreference"] = varReferenceFieldSpecs
result["namereference"] = nameReferenceFieldSpecs
result["image"] = imageFieldSpecs
result["images"] = imagesFieldSpecs
return result
}

View File

@@ -17,9 +17,15 @@ limitations under the License.
package defaultconfig
const (
imageFieldSpecs = `
image:
- path: containers
- path: initContainers
imagesFieldSpecs = `
images:
- kind: Pod
path: spec/initContainers
- kind: Pod
path: spec/containers
- kind: Deployment
path: spec/template/spec/initContainers
- kind: Deployment
path: spec/template/spec/containers
`
)