generate configmap for pruning

This commit is contained in:
Jingfang Liu
2019-04-05 16:13:15 -07:00
parent 4937b1c75e
commit 826affb8dd
17 changed files with 673 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package resource_test
import (
"reflect"
"testing"
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
@@ -94,3 +95,20 @@ func TestResourceId(t *testing.T) {
}
}
}
func TestDeepCopy(t *testing.T) {
r := factory.FromMap(
map[string]interface{}{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]interface{}{
"name": "pooh",
},
})
r.AppendRefBy(resid.NewResId(gvk.Gvk{Group: "somegroup", Kind: "MyKind"}, "random"))
cr := r.DeepCopy()
if !reflect.DeepEqual(r, cr) {
t.Errorf("expected %v\nbut got%v", r, cr)
}
}