mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 18:01:21 +00:00
add tests for resmap
This commit is contained in:
@@ -26,8 +26,6 @@ import (
|
||||
"github.com/ghodss/yaml"
|
||||
"github.com/golang/glog"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
internal "sigs.k8s.io/kustomize/pkg/internal/error"
|
||||
"sigs.k8s.io/kustomize/pkg/resid"
|
||||
@@ -125,20 +123,6 @@ func (m ResMap) DeepCopy() ResMap {
|
||||
return mcopy
|
||||
}
|
||||
|
||||
func (m ResMap) insert(newName string, obj *unstructured.Unstructured) error {
|
||||
oldName := obj.GetName()
|
||||
gvKind := gvk.FromSchemaGvk(obj.GroupVersionKind())
|
||||
id := resid.NewResId(gvKind, oldName)
|
||||
|
||||
if _, found := m[id]; found {
|
||||
return fmt.Errorf(
|
||||
"the <name: %q, GroupVersionKind: %v> already exists in the map", oldName, gvKind)
|
||||
}
|
||||
obj.SetName(newName)
|
||||
m[id] = resource.NewResourceFromUnstruct(*obj)
|
||||
return nil
|
||||
}
|
||||
|
||||
// FilterBy returns a ResMap containing ResIds with the same namespace and nameprefix
|
||||
// with the inputId
|
||||
func (m ResMap) FilterBy(inputId resid.ResId) ResMap {
|
||||
|
||||
Reference in New Issue
Block a user