mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
helper methods, types, and unit tests for transformer annotations
This commit is contained in:
@@ -21,6 +21,13 @@ type Transformer interface {
|
||||
Transform(m ResMap) error
|
||||
}
|
||||
|
||||
// A TransformerWithProperties contains a Transformer and stores
|
||||
// some of its properties
|
||||
type TransformerWithProperties struct {
|
||||
Transformer
|
||||
Origin *resource.Origin
|
||||
}
|
||||
|
||||
// A Generator creates an instance of ResMap.
|
||||
type Generator interface {
|
||||
Generate() (ResMap, error)
|
||||
@@ -144,10 +151,24 @@ type ResMap interface {
|
||||
AbsorbAll(ResMap) error
|
||||
|
||||
// AddOriginAnnotation will add the provided origin as
|
||||
// an annotation to all resources in the Resmap, if
|
||||
// an origin annotation to all resources in the ResMap, if
|
||||
// the origin is not nil.
|
||||
AddOriginAnnotation(origin *resource.Origin) error
|
||||
|
||||
// RemoveOriginAnnotation will remove the origin annotation
|
||||
// from all resources in the ResMap
|
||||
RemoveOriginAnnotations() error
|
||||
|
||||
// AddTransformerAnnotation will add the provided origin as
|
||||
// an origin annotation if the resource doesn't have one; a
|
||||
// transformer annotation otherwise; to all resources in
|
||||
// ResMap
|
||||
AddTransformerAnnotation(origin *resource.Origin) error
|
||||
|
||||
// RemoveTransformerAnnotation will remove the transformer annotation
|
||||
// from all resources in the ResMap
|
||||
RemoveTransformerAnnotations() error
|
||||
|
||||
// AnnotateAll annotates all resources in the ResMap with
|
||||
// the provided key value pair.
|
||||
AnnotateAll(key string, value string) error
|
||||
|
||||
Reference in New Issue
Block a user