Introduce gvk package to isolate apimachinery schema.

This commit is contained in:
Jeffrey Regan
2018-09-25 16:57:31 -07:00
parent 8aa0cc145c
commit fb355eb320
38 changed files with 570 additions and 477 deletions

View File

@@ -20,12 +20,12 @@ package resource
import (
"encoding/json"
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/kustomize/pkg/gvk"
)
// Resource is an "Unstructured" (json/map form) Kubernetes API resource object
@@ -77,7 +77,7 @@ func (r *Resource) IsGenerated() bool {
// Id returns the ResId for the resource.
func (r *Resource) Id() ResId {
return NewResId(r.GroupVersionKind(), r.GetName())
return NewResId(gvk.FromSchemaGvk(r.GroupVersionKind()), r.GetName())
}
// Merge performs merge with other resource.