mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
add origin annotation for resources generated by generators (#4341)
* add origin annotation for resources generated by builtin and custom generators * decouple origin data from generator data and account for inline generators
This commit is contained in:
@@ -26,6 +26,13 @@ type Generator interface {
|
||||
Generate() (ResMap, error)
|
||||
}
|
||||
|
||||
// A GeneratorWithProperties contains a Generator and stores
|
||||
// some of its properties
|
||||
type GeneratorWithProperties struct {
|
||||
Generator
|
||||
Origin *resource.Origin
|
||||
}
|
||||
|
||||
// Something that's configurable accepts an
|
||||
// instance of PluginHelpers and a raw config
|
||||
// object (YAML in []byte form).
|
||||
@@ -136,6 +143,11 @@ type ResMap interface {
|
||||
// self, then its behavior _cannot_ be merge or replace.
|
||||
AbsorbAll(ResMap) error
|
||||
|
||||
// AddOriginAnnotation will add the provided origin as
|
||||
// an annotation to all resources in the Resmap, if
|
||||
// the origin is not nil.
|
||||
AddOriginAnnotation(origin *resource.Origin) 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