mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-01 18:30:15 +00:00
refactor the strategic merge patch transformer toward moving it to a plugin (#1340)
This commit is contained in:
@@ -14,11 +14,12 @@ import (
|
||||
// Factory makes instances of ResMap.
|
||||
type Factory struct {
|
||||
resF *resource.Factory
|
||||
tf PatchFactory
|
||||
}
|
||||
|
||||
// NewFactory returns a new resmap.Factory.
|
||||
func NewFactory(rf *resource.Factory) *Factory {
|
||||
return &Factory{resF: rf}
|
||||
func NewFactory(rf *resource.Factory, tf PatchFactory) *Factory {
|
||||
return &Factory{resF: rf, tf: tf}
|
||||
}
|
||||
|
||||
// RF returns a resource.Factory.
|
||||
@@ -118,6 +119,11 @@ func (rmF *Factory) FromSecretArgs(
|
||||
return rmF.FromResource(res), nil
|
||||
}
|
||||
|
||||
func (rmF *Factory) MergePatches(patches []*resource.Resource) (
|
||||
ResMap, error) {
|
||||
return rmF.tf.MergePatches(patches, rmF.resF)
|
||||
}
|
||||
|
||||
func newResMapFromResourceSlice(resources []*resource.Resource) (ResMap, error) {
|
||||
result := New()
|
||||
for _, res := range resources {
|
||||
|
||||
Reference in New Issue
Block a user