mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-02-22 00:32:59 +08:00
code-generator: refer to the API package for GV{R,K}
There should only be one source of truth for the API group's name and version. Signed-off-by: Steve Kuznetsov <skuznets@redhat.com> Kubernetes-commit: e13198ec6f52c4a6405388e90053954dc7656a31
This commit is contained in:
parent
720872638d
commit
e293c67c9f
@ -23,7 +23,6 @@ import (
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
@ -36,9 +35,9 @@ type FakeFoos struct {
|
||||
ns string
|
||||
}
|
||||
|
||||
var foosResource = schema.GroupVersionResource{Group: "samplecontroller.k8s.io", Version: "v1alpha1", Resource: "foos"}
|
||||
var foosResource = v1alpha1.SchemeGroupVersion.WithResource("foos")
|
||||
|
||||
var foosKind = schema.GroupVersionKind{Group: "samplecontroller.k8s.io", Version: "v1alpha1", Kind: "Foo"}
|
||||
var foosKind = v1alpha1.SchemeGroupVersion.WithKind("Foo")
|
||||
|
||||
// Get takes name of the foo, and returns the corresponding foo object, and an error if there is any.
|
||||
func (c *FakeFoos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Foo, err error) {
|
||||
|
Loading…
Reference in New Issue
Block a user