Commit 6193335b authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #28985 from caesarxuchao/v1ojbref

Automatic merge from submit-queue move api.ObjectReference.ObjectKind to pkg/api/ref.go This is needed to convert k8s components to use versioned clientset. To let components use versioned client, we need to convert `pkg/client/record` to v1, which depends on `pkg/api/ref.go`, so we need to make a `pkg/api/v1/ref.go`. And this [line](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/ref.go#L44) requires v1.ObjectReference to be a runtime.Object. Moving `api.ObjectReference.ObjectKind` to `pkg/api/ref.go` will make the writing a conversion script easier because all the necessary changes will be restricted in `ref.go`.
parents e3ddf0fb 3fb678ac
...@@ -67,8 +67,6 @@ func ListMetaFor(obj runtime.Object) (*unversioned.ListMeta, error) { ...@@ -67,8 +67,6 @@ func ListMetaFor(obj runtime.Object) (*unversioned.ListMeta, error) {
func (obj *ObjectMeta) GetObjectMeta() meta.Object { return obj } func (obj *ObjectMeta) GetObjectMeta() meta.Object { return obj }
func (obj *ObjectReference) GetObjectKind() unversioned.ObjectKind { return obj }
// Namespace implements meta.Object for any object with an ObjectMeta typed field. Allows // Namespace implements meta.Object for any object with an ObjectMeta typed field. Allows
// fast, direct access to metadata fields for API objects. // fast, direct access to metadata fields for API objects.
func (meta *ObjectMeta) GetNamespace() string { return meta.Namespace } func (meta *ObjectMeta) GetNamespace() string { return meta.Namespace }
......
...@@ -128,3 +128,5 @@ func (obj *ObjectReference) SetGroupVersionKind(gvk unversioned.GroupVersionKind ...@@ -128,3 +128,5 @@ func (obj *ObjectReference) SetGroupVersionKind(gvk unversioned.GroupVersionKind
func (obj *ObjectReference) GroupVersionKind() unversioned.GroupVersionKind { func (obj *ObjectReference) GroupVersionKind() unversioned.GroupVersionKind {
return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind) return unversioned.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
} }
func (obj *ObjectReference) GetObjectKind() unversioned.ObjectKind { return obj }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment