@@ -37,27 +37,47 @@ Option in `skaffold.yaml`
37
37
deploy :
38
38
config :
39
39
transformableAllowList :
40
- - Group : example.com
41
- Kind : Application
42
- - Group : argoproj.io
43
- Kind : Workflow
44
- - Group : tekton.dev
45
- Kind : Task
40
+ - type : pod # no group, implicitly all versions
41
+ - type : batch/Job # group, implicitly all versions
42
+ - type : openfaas.com/v1/Function
43
+ image : [spec.image]
44
+ labels : [spec.metadata.labels, spec.labels] # https://www.openfaas.com/blog/manage-functions-with-kubectl/
45
+ - type : apps/v1beta1/Deployment
46
+ image : [spec.template.spec.initContainers.*.image, spec.template.spec.containers.*.image]
47
+ labels : [spec.metadata.labels, spec.template.metadata.labels]
46
48
` ` `
47
49
50
+ The value of ` type` field points to a resource type. So it's case sensitive
51
+ and should support API groups and resource versions :
52
+
53
+ * When not specifying group, it will transform given resource type of any group or versions.
54
+ * When providing group but not resource version, it will transform given
55
+ resource type of any versions.
56
+
57
+ The value of `labels` field is a list of JSON-path-like paths to apply `labels`
58
+ block to. If no `labels` field configured, it will simply apply `labels` block
59
+ if missing.
60
+
61
+ The value of `image` field is also a list of JSON-path-like paths to rewrite. If
62
+ no `image` field configured, it will rewrite any field named `image`.
63
+
48
64
# # Open issues/Questions
49
65
50
66
Since it is an allowlist, neither options could disable transformation on any
51
- built-in resource like ` ReplicaSet` or `Deployment`.
67
+ built-in resource like `ReplicaSet` or `Deployment`. However, it may need to
68
+ refactor [current allowlist](https://github.com/GoogleContainerTools/skaffold/blob/27c38228ab929ddaf2636637b43f17fda1686652/pkg/skaffold/kubernetes/manifest/visitor.go#L28-L43).
52
69
53
70
Is there any need to work out a deny list?
54
71
55
72
# # Implementation plan
56
73
57
74
1. `pkg/skaffold/schema/latest/v1/config.go` - Add config option
58
75
` transformableAllowList` to `DeployConfig`.
59
- 2. `pkg/skaffold/kubernetes/manifest/visitor.go` - Add new parameter `transformableAllowList`
60
- to `*ManifestList.Visit()` by appending it to existing coded `transformableAllowList`
76
+ 2. `pkg/skaffold/kubernetes/manifest/visitor.go` - Refactor allowlist and add
77
+ new parameter `transformableAllowList` to `*ManifestList.Visit()` by appending
78
+ it to existing coded `transformableAllowList`
79
+ - Support `labels` field
80
+ - Support `image` field
61
81
3. `pkg/skaffold/kubernetes/manifest/images.go` - Add new parameter to `*ManifestList.ReplaceImages()`
62
82
to support given `transformableAllowList`
63
83
4. Instrument each deployer to use the new parameter `transformableAllowList`
0 commit comments