diff --git a/apis/kustomize/kustomize_types.go b/apis/kustomize/kustomize_types.go index 1718ba88..1c929845 100644 --- a/apis/kustomize/kustomize_types.go +++ b/apis/kustomize/kustomize_types.go @@ -86,6 +86,20 @@ type Selector struct { LabelSelector string `json:"labelSelector,omitempty"` } +// Patch contains either a StrategicMerge or a JSON6902 patch, either a file or inline, +// and the target the patch should be applied to. +type Patch struct { + // Patch contains the JSON6902 patch document with an array of + // operation objects. + // +required + Patch string `json:"patch,omitempty"` + + // Target points to the resources that the patch document should + // be applied to. + // +optional + Target Selector `json:"target,omitempty"` +} + // JSON6902 is a JSON6902 operation object. // https://tools.ietf.org/html/rfc6902#section-4 type JSON6902 struct { diff --git a/apis/kustomize/zz_generated.deepcopy.go b/apis/kustomize/zz_generated.deepcopy.go index a65f9075..0ad952f8 100644 --- a/apis/kustomize/zz_generated.deepcopy.go +++ b/apis/kustomize/zz_generated.deepcopy.go @@ -82,6 +82,22 @@ func (in *JSON6902Patch) DeepCopy() *JSON6902Patch { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Patch) DeepCopyInto(out *Patch) { + *out = *in + out.Target = in.Target +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Patch. +func (in *Patch) DeepCopy() *Patch { + if in == nil { + return nil + } + out := new(Patch) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Selector) DeepCopyInto(out *Selector) { *out = *in