diff --git a/addon/v1alpha1/doc.go b/addon/v1alpha1/doc.go index 77ec27684..0511f4dff 100644 --- a/addon/v1alpha1/doc.go +++ b/addon/v1alpha1/doc.go @@ -1,6 +1,5 @@ // Package v1alpha1 contains API Schema definitions for the addon v1alpha1 API group // +k8s:deepcopy-gen=package,register -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/client/addon/clientset/versioned/doc.go b/client/addon/clientset/versioned/doc.go deleted file mode 100644 index 0e0c2a890..000000000 --- a/client/addon/clientset/versioned/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addondeploymentconfig.go b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addondeploymentconfig.go index 36b22b43e..b607f65f8 100644 --- a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addondeploymentconfig.go +++ b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addondeploymentconfig.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakeAddOnDeploymentConfigs struct { ns string } -var addondeploymentconfigsResource = schema.GroupVersionResource{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Resource: "addondeploymentconfigs"} +var addondeploymentconfigsResource = v1alpha1.SchemeGroupVersion.WithResource("addondeploymentconfigs") -var addondeploymentconfigsKind = schema.GroupVersionKind{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Kind: "AddOnDeploymentConfig"} +var addondeploymentconfigsKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnDeploymentConfig") // Get takes name of the addOnDeploymentConfig, and returns the corresponding addOnDeploymentConfig object, and an error if there is any. func (c *FakeAddOnDeploymentConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) { diff --git a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addontemplate.go b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addontemplate.go index 8d941bec4..65fd19a6e 100644 --- a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addontemplate.go +++ b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_addontemplate.go @@ -7,7 +7,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" @@ -19,9 +18,9 @@ type FakeAddOnTemplates struct { Fake *FakeAddonV1alpha1 } -var addontemplatesResource = schema.GroupVersionResource{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Resource: "addontemplates"} +var addontemplatesResource = v1alpha1.SchemeGroupVersion.WithResource("addontemplates") -var addontemplatesKind = schema.GroupVersionKind{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Kind: "AddOnTemplate"} +var addontemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnTemplate") // Get takes name of the addOnTemplate, and returns the corresponding addOnTemplate object, and an error if there is any. func (c *FakeAddOnTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnTemplate, err error) { diff --git a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_clustermanagementaddon.go b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_clustermanagementaddon.go index 40c4cae86..e7a8c164f 100644 --- a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_clustermanagementaddon.go +++ b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_clustermanagementaddon.go @@ -7,7 +7,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" @@ -19,9 +18,9 @@ type FakeClusterManagementAddOns struct { Fake *FakeAddonV1alpha1 } -var clustermanagementaddonsResource = schema.GroupVersionResource{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Resource: "clustermanagementaddons"} +var clustermanagementaddonsResource = v1alpha1.SchemeGroupVersion.WithResource("clustermanagementaddons") -var clustermanagementaddonsKind = schema.GroupVersionKind{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Kind: "ClusterManagementAddOn"} +var clustermanagementaddonsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterManagementAddOn") // Get takes name of the clusterManagementAddOn, and returns the corresponding clusterManagementAddOn object, and an error if there is any. func (c *FakeClusterManagementAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterManagementAddOn, err error) { diff --git a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_managedclusteraddon.go b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_managedclusteraddon.go index c9adc0658..a7fadcc1a 100644 --- a/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_managedclusteraddon.go +++ b/client/addon/clientset/versioned/typed/addon/v1alpha1/fake/fake_managedclusteraddon.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakeManagedClusterAddOns struct { ns string } -var managedclusteraddonsResource = schema.GroupVersionResource{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Resource: "managedclusteraddons"} +var managedclusteraddonsResource = v1alpha1.SchemeGroupVersion.WithResource("managedclusteraddons") -var managedclusteraddonsKind = schema.GroupVersionKind{Group: "addon.open-cluster-management.io", Version: "v1alpha1", Kind: "ManagedClusterAddOn"} +var managedclusteraddonsKind = v1alpha1.SchemeGroupVersion.WithKind("ManagedClusterAddOn") // Get takes name of the managedClusterAddOn, and returns the corresponding managedClusterAddOn object, and an error if there is any. func (c *FakeManagedClusterAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterAddOn, err error) { diff --git a/client/addon/informers/externalversions/factory.go b/client/addon/informers/externalversions/factory.go index 3132431b9..b1c7a027b 100644 --- a/client/addon/informers/externalversions/factory.go +++ b/client/addon/informers/externalversions/factory.go @@ -150,7 +150,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -223,7 +223,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/client/cluster/clientset/versioned/doc.go b/client/cluster/clientset/versioned/doc.go deleted file mode 100644 index 0e0c2a890..000000000 --- a/client/cluster/clientset/versioned/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/client/cluster/clientset/versioned/typed/cluster/v1/fake/fake_managedcluster.go b/client/cluster/clientset/versioned/typed/cluster/v1/fake/fake_managedcluster.go index fd5f6e8b7..c1a789f87 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1/fake/fake_managedcluster.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1/fake/fake_managedcluster.go @@ -5,13 +5,12 @@ package fake import ( "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "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" - clusterv1 "open-cluster-management.io/api/cluster/v1" + v1 "open-cluster-management.io/api/cluster/v1" ) // FakeManagedClusters implements ManagedClusterInterface @@ -19,24 +18,24 @@ type FakeManagedClusters struct { Fake *FakeClusterV1 } -var managedclustersResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1", Resource: "managedclusters"} +var managedclustersResource = v1.SchemeGroupVersion.WithResource("managedclusters") -var managedclustersKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1", Kind: "ManagedCluster"} +var managedclustersKind = v1.SchemeGroupVersion.WithKind("ManagedCluster") // Get takes name of the managedCluster, and returns the corresponding managedCluster object, and an error if there is any. -func (c *FakeManagedClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *clusterv1.ManagedCluster, err error) { +func (c *FakeManagedClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ManagedCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(managedclustersResource, name), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootGetAction(managedclustersResource, name), &v1.ManagedCluster{}) if obj == nil { return nil, err } - return obj.(*clusterv1.ManagedCluster), err + return obj.(*v1.ManagedCluster), err } // List takes label and field selectors, and returns the list of ManagedClusters that match those selectors. -func (c *FakeManagedClusters) List(ctx context.Context, opts v1.ListOptions) (result *clusterv1.ManagedClusterList, err error) { +func (c *FakeManagedClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ManagedClusterList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(managedclustersResource, managedclustersKind, opts), &clusterv1.ManagedClusterList{}) + Invokes(testing.NewRootListAction(managedclustersResource, managedclustersKind, opts), &v1.ManagedClusterList{}) if obj == nil { return nil, err } @@ -45,8 +44,8 @@ func (c *FakeManagedClusters) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &clusterv1.ManagedClusterList{ListMeta: obj.(*clusterv1.ManagedClusterList).ListMeta} - for _, item := range obj.(*clusterv1.ManagedClusterList).Items { + list := &v1.ManagedClusterList{ListMeta: obj.(*v1.ManagedClusterList).ListMeta} + for _, item := range obj.(*v1.ManagedClusterList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -55,63 +54,63 @@ func (c *FakeManagedClusters) List(ctx context.Context, opts v1.ListOptions) (re } // Watch returns a watch.Interface that watches the requested managedClusters. -func (c *FakeManagedClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeManagedClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(managedclustersResource, opts)) } // Create takes the representation of a managedCluster and creates it. Returns the server's representation of the managedCluster, and an error, if there is any. -func (c *FakeManagedClusters) Create(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts v1.CreateOptions) (result *clusterv1.ManagedCluster, err error) { +func (c *FakeManagedClusters) Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (result *v1.ManagedCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(managedclustersResource, managedCluster), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootCreateAction(managedclustersResource, managedCluster), &v1.ManagedCluster{}) if obj == nil { return nil, err } - return obj.(*clusterv1.ManagedCluster), err + return obj.(*v1.ManagedCluster), err } // Update takes the representation of a managedCluster and updates it. Returns the server's representation of the managedCluster, and an error, if there is any. -func (c *FakeManagedClusters) Update(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts v1.UpdateOptions) (result *clusterv1.ManagedCluster, err error) { +func (c *FakeManagedClusters) Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(managedclustersResource, managedCluster), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootUpdateAction(managedclustersResource, managedCluster), &v1.ManagedCluster{}) if obj == nil { return nil, err } - return obj.(*clusterv1.ManagedCluster), err + return obj.(*v1.ManagedCluster), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeManagedClusters) UpdateStatus(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts v1.UpdateOptions) (*clusterv1.ManagedCluster, error) { +func (c *FakeManagedClusters) UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(managedclustersResource, "status", managedCluster), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootUpdateSubresourceAction(managedclustersResource, "status", managedCluster), &v1.ManagedCluster{}) if obj == nil { return nil, err } - return obj.(*clusterv1.ManagedCluster), err + return obj.(*v1.ManagedCluster), err } // Delete takes name of the managedCluster and deletes it. Returns an error if one occurs. -func (c *FakeManagedClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeManagedClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(managedclustersResource, name, opts), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootDeleteActionWithOptions(managedclustersResource, name, opts), &v1.ManagedCluster{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeManagedClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeManagedClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(managedclustersResource, listOpts) - _, err := c.Fake.Invokes(action, &clusterv1.ManagedClusterList{}) + _, err := c.Fake.Invokes(action, &v1.ManagedClusterList{}) return err } // Patch applies the patch and returns the patched managedCluster. -func (c *FakeManagedClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1.ManagedCluster, err error) { +func (c *FakeManagedClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(managedclustersResource, name, pt, data, subresources...), &clusterv1.ManagedCluster{}) + Invokes(testing.NewRootPatchSubresourceAction(managedclustersResource, name, pt, data, subresources...), &v1.ManagedCluster{}) if obj == nil { return nil, err } - return obj.(*clusterv1.ManagedCluster), err + return obj.(*v1.ManagedCluster), err } diff --git a/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_addonplacementscore.go b/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_addonplacementscore.go index 6534f5cb2..821628ccb 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_addonplacementscore.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_addonplacementscore.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakeAddOnPlacementScores struct { ns string } -var addonplacementscoresResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1alpha1", Resource: "addonplacementscores"} +var addonplacementscoresResource = v1alpha1.SchemeGroupVersion.WithResource("addonplacementscores") -var addonplacementscoresKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1alpha1", Kind: "AddOnPlacementScore"} +var addonplacementscoresKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnPlacementScore") // Get takes name of the addOnPlacementScore, and returns the corresponding addOnPlacementScore object, and an error if there is any. func (c *FakeAddOnPlacementScores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnPlacementScore, err error) { diff --git a/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_clusterclaim.go b/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_clusterclaim.go index 3f0af0809..1f2c43a3b 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_clusterclaim.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_clusterclaim.go @@ -7,7 +7,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" @@ -19,9 +18,9 @@ type FakeClusterClaims struct { Fake *FakeClusterV1alpha1 } -var clusterclaimsResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1alpha1", Resource: "clusterclaims"} +var clusterclaimsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterclaims") -var clusterclaimsKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1alpha1", Kind: "ClusterClaim"} +var clusterclaimsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterClaim") // Get takes name of the clusterClaim, and returns the corresponding clusterClaim object, and an error if there is any. func (c *FakeClusterClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterClaim, err error) { diff --git a/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placement.go b/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placement.go index 1b8d26705..60bbd5df6 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placement.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placement.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakePlacements struct { ns string } -var placementsResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1beta1", Resource: "placements"} +var placementsResource = v1beta1.SchemeGroupVersion.WithResource("placements") -var placementsKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1beta1", Kind: "Placement"} +var placementsKind = v1beta1.SchemeGroupVersion.WithKind("Placement") // Get takes name of the placement, and returns the corresponding placement object, and an error if there is any. func (c *FakePlacements) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Placement, err error) { diff --git a/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placementdecision.go b/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placementdecision.go index b87b0e1b1..bb42588ae 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placementdecision.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1beta1/fake/fake_placementdecision.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakePlacementDecisions struct { ns string } -var placementdecisionsResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1beta1", Resource: "placementdecisions"} +var placementdecisionsResource = v1beta1.SchemeGroupVersion.WithResource("placementdecisions") -var placementdecisionsKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1beta1", Kind: "PlacementDecision"} +var placementdecisionsKind = v1beta1.SchemeGroupVersion.WithKind("PlacementDecision") // Get takes name of the placementDecision, and returns the corresponding placementDecision object, and an error if there is any. func (c *FakePlacementDecisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PlacementDecision, err error) { diff --git a/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclusterset.go b/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclusterset.go index 94fed9547..74c6cf923 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclusterset.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclusterset.go @@ -7,7 +7,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" @@ -19,9 +18,9 @@ type FakeManagedClusterSets struct { Fake *FakeClusterV1beta2 } -var managedclustersetsResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1beta2", Resource: "managedclustersets"} +var managedclustersetsResource = v1beta2.SchemeGroupVersion.WithResource("managedclustersets") -var managedclustersetsKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1beta2", Kind: "ManagedClusterSet"} +var managedclustersetsKind = v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSet") // Get takes name of the managedClusterSet, and returns the corresponding managedClusterSet object, and an error if there is any. func (c *FakeManagedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSet, err error) { diff --git a/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclustersetbinding.go b/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclustersetbinding.go index 920369273..80f3f5fd6 100644 --- a/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclustersetbinding.go +++ b/client/cluster/clientset/versioned/typed/cluster/v1beta2/fake/fake_managedclustersetbinding.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakeManagedClusterSetBindings struct { ns string } -var managedclustersetbindingsResource = schema.GroupVersionResource{Group: "cluster.open-cluster-management.io", Version: "v1beta2", Resource: "managedclustersetbindings"} +var managedclustersetbindingsResource = v1beta2.SchemeGroupVersion.WithResource("managedclustersetbindings") -var managedclustersetbindingsKind = schema.GroupVersionKind{Group: "cluster.open-cluster-management.io", Version: "v1beta2", Kind: "ManagedClusterSetBinding"} +var managedclustersetbindingsKind = v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSetBinding") // Get takes name of the managedClusterSetBinding, and returns the corresponding managedClusterSetBinding object, and an error if there is any. func (c *FakeManagedClusterSetBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSetBinding, err error) { diff --git a/client/cluster/informers/externalversions/factory.go b/client/cluster/informers/externalversions/factory.go index f35711312..91aad0f2d 100644 --- a/client/cluster/informers/externalversions/factory.go +++ b/client/cluster/informers/externalversions/factory.go @@ -150,7 +150,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -223,7 +223,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/client/operator/clientset/versioned/doc.go b/client/operator/clientset/versioned/doc.go deleted file mode 100644 index 0e0c2a890..000000000 --- a/client/operator/clientset/versioned/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/client/operator/clientset/versioned/typed/operator/v1/fake/fake_clustermanager.go b/client/operator/clientset/versioned/typed/operator/v1/fake/fake_clustermanager.go index e49f213f7..a81bda092 100644 --- a/client/operator/clientset/versioned/typed/operator/v1/fake/fake_clustermanager.go +++ b/client/operator/clientset/versioned/typed/operator/v1/fake/fake_clustermanager.go @@ -5,13 +5,12 @@ package fake import ( "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "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" - operatorv1 "open-cluster-management.io/api/operator/v1" + v1 "open-cluster-management.io/api/operator/v1" ) // FakeClusterManagers implements ClusterManagerInterface @@ -19,24 +18,24 @@ type FakeClusterManagers struct { Fake *FakeOperatorV1 } -var clustermanagersResource = schema.GroupVersionResource{Group: "operator.open-cluster-management.io", Version: "v1", Resource: "clustermanagers"} +var clustermanagersResource = v1.SchemeGroupVersion.WithResource("clustermanagers") -var clustermanagersKind = schema.GroupVersionKind{Group: "operator.open-cluster-management.io", Version: "v1", Kind: "ClusterManager"} +var clustermanagersKind = v1.SchemeGroupVersion.WithKind("ClusterManager") // Get takes name of the clusterManager, and returns the corresponding clusterManager object, and an error if there is any. -func (c *FakeClusterManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *operatorv1.ClusterManager, err error) { +func (c *FakeClusterManagers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterManager, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustermanagersResource, name), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootGetAction(clustermanagersResource, name), &v1.ClusterManager{}) if obj == nil { return nil, err } - return obj.(*operatorv1.ClusterManager), err + return obj.(*v1.ClusterManager), err } // List takes label and field selectors, and returns the list of ClusterManagers that match those selectors. -func (c *FakeClusterManagers) List(ctx context.Context, opts v1.ListOptions) (result *operatorv1.ClusterManagerList, err error) { +func (c *FakeClusterManagers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterManagerList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustermanagersResource, clustermanagersKind, opts), &operatorv1.ClusterManagerList{}) + Invokes(testing.NewRootListAction(clustermanagersResource, clustermanagersKind, opts), &v1.ClusterManagerList{}) if obj == nil { return nil, err } @@ -45,8 +44,8 @@ func (c *FakeClusterManagers) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &operatorv1.ClusterManagerList{ListMeta: obj.(*operatorv1.ClusterManagerList).ListMeta} - for _, item := range obj.(*operatorv1.ClusterManagerList).Items { + list := &v1.ClusterManagerList{ListMeta: obj.(*v1.ClusterManagerList).ListMeta} + for _, item := range obj.(*v1.ClusterManagerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -55,63 +54,63 @@ func (c *FakeClusterManagers) List(ctx context.Context, opts v1.ListOptions) (re } // Watch returns a watch.Interface that watches the requested clusterManagers. -func (c *FakeClusterManagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeClusterManagers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(clustermanagersResource, opts)) } // Create takes the representation of a clusterManager and creates it. Returns the server's representation of the clusterManager, and an error, if there is any. -func (c *FakeClusterManagers) Create(ctx context.Context, clusterManager *operatorv1.ClusterManager, opts v1.CreateOptions) (result *operatorv1.ClusterManager, err error) { +func (c *FakeClusterManagers) Create(ctx context.Context, clusterManager *v1.ClusterManager, opts metav1.CreateOptions) (result *v1.ClusterManager, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustermanagersResource, clusterManager), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootCreateAction(clustermanagersResource, clusterManager), &v1.ClusterManager{}) if obj == nil { return nil, err } - return obj.(*operatorv1.ClusterManager), err + return obj.(*v1.ClusterManager), err } // Update takes the representation of a clusterManager and updates it. Returns the server's representation of the clusterManager, and an error, if there is any. -func (c *FakeClusterManagers) Update(ctx context.Context, clusterManager *operatorv1.ClusterManager, opts v1.UpdateOptions) (result *operatorv1.ClusterManager, err error) { +func (c *FakeClusterManagers) Update(ctx context.Context, clusterManager *v1.ClusterManager, opts metav1.UpdateOptions) (result *v1.ClusterManager, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustermanagersResource, clusterManager), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootUpdateAction(clustermanagersResource, clusterManager), &v1.ClusterManager{}) if obj == nil { return nil, err } - return obj.(*operatorv1.ClusterManager), err + return obj.(*v1.ClusterManager), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterManagers) UpdateStatus(ctx context.Context, clusterManager *operatorv1.ClusterManager, opts v1.UpdateOptions) (*operatorv1.ClusterManager, error) { +func (c *FakeClusterManagers) UpdateStatus(ctx context.Context, clusterManager *v1.ClusterManager, opts metav1.UpdateOptions) (*v1.ClusterManager, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustermanagersResource, "status", clusterManager), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootUpdateSubresourceAction(clustermanagersResource, "status", clusterManager), &v1.ClusterManager{}) if obj == nil { return nil, err } - return obj.(*operatorv1.ClusterManager), err + return obj.(*v1.ClusterManager), err } // Delete takes name of the clusterManager and deletes it. Returns an error if one occurs. -func (c *FakeClusterManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeClusterManagers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clustermanagersResource, name, opts), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootDeleteActionWithOptions(clustermanagersResource, name, opts), &v1.ClusterManager{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeClusterManagers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(clustermanagersResource, listOpts) - _, err := c.Fake.Invokes(action, &operatorv1.ClusterManagerList{}) + _, err := c.Fake.Invokes(action, &v1.ClusterManagerList{}) return err } // Patch applies the patch and returns the patched clusterManager. -func (c *FakeClusterManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *operatorv1.ClusterManager, err error) { +func (c *FakeClusterManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterManager, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustermanagersResource, name, pt, data, subresources...), &operatorv1.ClusterManager{}) + Invokes(testing.NewRootPatchSubresourceAction(clustermanagersResource, name, pt, data, subresources...), &v1.ClusterManager{}) if obj == nil { return nil, err } - return obj.(*operatorv1.ClusterManager), err + return obj.(*v1.ClusterManager), err } diff --git a/client/operator/clientset/versioned/typed/operator/v1/fake/fake_klusterlet.go b/client/operator/clientset/versioned/typed/operator/v1/fake/fake_klusterlet.go index cbeb95250..8d2b3acaa 100644 --- a/client/operator/clientset/versioned/typed/operator/v1/fake/fake_klusterlet.go +++ b/client/operator/clientset/versioned/typed/operator/v1/fake/fake_klusterlet.go @@ -5,13 +5,12 @@ package fake import ( "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "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" - operatorv1 "open-cluster-management.io/api/operator/v1" + v1 "open-cluster-management.io/api/operator/v1" ) // FakeKlusterlets implements KlusterletInterface @@ -19,24 +18,24 @@ type FakeKlusterlets struct { Fake *FakeOperatorV1 } -var klusterletsResource = schema.GroupVersionResource{Group: "operator.open-cluster-management.io", Version: "v1", Resource: "klusterlets"} +var klusterletsResource = v1.SchemeGroupVersion.WithResource("klusterlets") -var klusterletsKind = schema.GroupVersionKind{Group: "operator.open-cluster-management.io", Version: "v1", Kind: "Klusterlet"} +var klusterletsKind = v1.SchemeGroupVersion.WithKind("Klusterlet") // Get takes name of the klusterlet, and returns the corresponding klusterlet object, and an error if there is any. -func (c *FakeKlusterlets) Get(ctx context.Context, name string, options v1.GetOptions) (result *operatorv1.Klusterlet, err error) { +func (c *FakeKlusterlets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Klusterlet, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(klusterletsResource, name), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootGetAction(klusterletsResource, name), &v1.Klusterlet{}) if obj == nil { return nil, err } - return obj.(*operatorv1.Klusterlet), err + return obj.(*v1.Klusterlet), err } // List takes label and field selectors, and returns the list of Klusterlets that match those selectors. -func (c *FakeKlusterlets) List(ctx context.Context, opts v1.ListOptions) (result *operatorv1.KlusterletList, err error) { +func (c *FakeKlusterlets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KlusterletList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(klusterletsResource, klusterletsKind, opts), &operatorv1.KlusterletList{}) + Invokes(testing.NewRootListAction(klusterletsResource, klusterletsKind, opts), &v1.KlusterletList{}) if obj == nil { return nil, err } @@ -45,8 +44,8 @@ func (c *FakeKlusterlets) List(ctx context.Context, opts v1.ListOptions) (result if label == nil { label = labels.Everything() } - list := &operatorv1.KlusterletList{ListMeta: obj.(*operatorv1.KlusterletList).ListMeta} - for _, item := range obj.(*operatorv1.KlusterletList).Items { + list := &v1.KlusterletList{ListMeta: obj.(*v1.KlusterletList).ListMeta} + for _, item := range obj.(*v1.KlusterletList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -55,63 +54,63 @@ func (c *FakeKlusterlets) List(ctx context.Context, opts v1.ListOptions) (result } // Watch returns a watch.Interface that watches the requested klusterlets. -func (c *FakeKlusterlets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeKlusterlets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(klusterletsResource, opts)) } // Create takes the representation of a klusterlet and creates it. Returns the server's representation of the klusterlet, and an error, if there is any. -func (c *FakeKlusterlets) Create(ctx context.Context, klusterlet *operatorv1.Klusterlet, opts v1.CreateOptions) (result *operatorv1.Klusterlet, err error) { +func (c *FakeKlusterlets) Create(ctx context.Context, klusterlet *v1.Klusterlet, opts metav1.CreateOptions) (result *v1.Klusterlet, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(klusterletsResource, klusterlet), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootCreateAction(klusterletsResource, klusterlet), &v1.Klusterlet{}) if obj == nil { return nil, err } - return obj.(*operatorv1.Klusterlet), err + return obj.(*v1.Klusterlet), err } // Update takes the representation of a klusterlet and updates it. Returns the server's representation of the klusterlet, and an error, if there is any. -func (c *FakeKlusterlets) Update(ctx context.Context, klusterlet *operatorv1.Klusterlet, opts v1.UpdateOptions) (result *operatorv1.Klusterlet, err error) { +func (c *FakeKlusterlets) Update(ctx context.Context, klusterlet *v1.Klusterlet, opts metav1.UpdateOptions) (result *v1.Klusterlet, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(klusterletsResource, klusterlet), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootUpdateAction(klusterletsResource, klusterlet), &v1.Klusterlet{}) if obj == nil { return nil, err } - return obj.(*operatorv1.Klusterlet), err + return obj.(*v1.Klusterlet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeKlusterlets) UpdateStatus(ctx context.Context, klusterlet *operatorv1.Klusterlet, opts v1.UpdateOptions) (*operatorv1.Klusterlet, error) { +func (c *FakeKlusterlets) UpdateStatus(ctx context.Context, klusterlet *v1.Klusterlet, opts metav1.UpdateOptions) (*v1.Klusterlet, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(klusterletsResource, "status", klusterlet), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootUpdateSubresourceAction(klusterletsResource, "status", klusterlet), &v1.Klusterlet{}) if obj == nil { return nil, err } - return obj.(*operatorv1.Klusterlet), err + return obj.(*v1.Klusterlet), err } // Delete takes name of the klusterlet and deletes it. Returns an error if one occurs. -func (c *FakeKlusterlets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeKlusterlets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(klusterletsResource, name, opts), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootDeleteActionWithOptions(klusterletsResource, name, opts), &v1.Klusterlet{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeKlusterlets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeKlusterlets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(klusterletsResource, listOpts) - _, err := c.Fake.Invokes(action, &operatorv1.KlusterletList{}) + _, err := c.Fake.Invokes(action, &v1.KlusterletList{}) return err } // Patch applies the patch and returns the patched klusterlet. -func (c *FakeKlusterlets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *operatorv1.Klusterlet, err error) { +func (c *FakeKlusterlets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Klusterlet, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(klusterletsResource, name, pt, data, subresources...), &operatorv1.Klusterlet{}) + Invokes(testing.NewRootPatchSubresourceAction(klusterletsResource, name, pt, data, subresources...), &v1.Klusterlet{}) if obj == nil { return nil, err } - return obj.(*operatorv1.Klusterlet), err + return obj.(*v1.Klusterlet), err } diff --git a/client/operator/informers/externalversions/factory.go b/client/operator/informers/externalversions/factory.go index 7dd83c550..b04f67831 100644 --- a/client/operator/informers/externalversions/factory.go +++ b/client/operator/informers/externalversions/factory.go @@ -150,7 +150,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -223,7 +223,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/client/work/clientset/versioned/doc.go b/client/work/clientset/versioned/doc.go deleted file mode 100644 index 0e0c2a890..000000000 --- a/client/work/clientset/versioned/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/client/work/clientset/versioned/typed/work/v1/fake/fake_appliedmanifestwork.go b/client/work/clientset/versioned/typed/work/v1/fake/fake_appliedmanifestwork.go index 38f97f61c..af88a9732 100644 --- a/client/work/clientset/versioned/typed/work/v1/fake/fake_appliedmanifestwork.go +++ b/client/work/clientset/versioned/typed/work/v1/fake/fake_appliedmanifestwork.go @@ -5,13 +5,12 @@ package fake import ( "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "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" - workv1 "open-cluster-management.io/api/work/v1" + v1 "open-cluster-management.io/api/work/v1" ) // FakeAppliedManifestWorks implements AppliedManifestWorkInterface @@ -19,24 +18,24 @@ type FakeAppliedManifestWorks struct { Fake *FakeWorkV1 } -var appliedmanifestworksResource = schema.GroupVersionResource{Group: "work.open-cluster-management.io", Version: "v1", Resource: "appliedmanifestworks"} +var appliedmanifestworksResource = v1.SchemeGroupVersion.WithResource("appliedmanifestworks") -var appliedmanifestworksKind = schema.GroupVersionKind{Group: "work.open-cluster-management.io", Version: "v1", Kind: "AppliedManifestWork"} +var appliedmanifestworksKind = v1.SchemeGroupVersion.WithKind("AppliedManifestWork") // Get takes name of the appliedManifestWork, and returns the corresponding appliedManifestWork object, and an error if there is any. -func (c *FakeAppliedManifestWorks) Get(ctx context.Context, name string, options v1.GetOptions) (result *workv1.AppliedManifestWork, err error) { +func (c *FakeAppliedManifestWorks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AppliedManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(appliedmanifestworksResource, name), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootGetAction(appliedmanifestworksResource, name), &v1.AppliedManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.AppliedManifestWork), err + return obj.(*v1.AppliedManifestWork), err } // List takes label and field selectors, and returns the list of AppliedManifestWorks that match those selectors. -func (c *FakeAppliedManifestWorks) List(ctx context.Context, opts v1.ListOptions) (result *workv1.AppliedManifestWorkList, err error) { +func (c *FakeAppliedManifestWorks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppliedManifestWorkList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(appliedmanifestworksResource, appliedmanifestworksKind, opts), &workv1.AppliedManifestWorkList{}) + Invokes(testing.NewRootListAction(appliedmanifestworksResource, appliedmanifestworksKind, opts), &v1.AppliedManifestWorkList{}) if obj == nil { return nil, err } @@ -45,8 +44,8 @@ func (c *FakeAppliedManifestWorks) List(ctx context.Context, opts v1.ListOptions if label == nil { label = labels.Everything() } - list := &workv1.AppliedManifestWorkList{ListMeta: obj.(*workv1.AppliedManifestWorkList).ListMeta} - for _, item := range obj.(*workv1.AppliedManifestWorkList).Items { + list := &v1.AppliedManifestWorkList{ListMeta: obj.(*v1.AppliedManifestWorkList).ListMeta} + for _, item := range obj.(*v1.AppliedManifestWorkList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -55,63 +54,63 @@ func (c *FakeAppliedManifestWorks) List(ctx context.Context, opts v1.ListOptions } // Watch returns a watch.Interface that watches the requested appliedManifestWorks. -func (c *FakeAppliedManifestWorks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeAppliedManifestWorks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(appliedmanifestworksResource, opts)) } // Create takes the representation of a appliedManifestWork and creates it. Returns the server's representation of the appliedManifestWork, and an error, if there is any. -func (c *FakeAppliedManifestWorks) Create(ctx context.Context, appliedManifestWork *workv1.AppliedManifestWork, opts v1.CreateOptions) (result *workv1.AppliedManifestWork, err error) { +func (c *FakeAppliedManifestWorks) Create(ctx context.Context, appliedManifestWork *v1.AppliedManifestWork, opts metav1.CreateOptions) (result *v1.AppliedManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(appliedmanifestworksResource, appliedManifestWork), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootCreateAction(appliedmanifestworksResource, appliedManifestWork), &v1.AppliedManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.AppliedManifestWork), err + return obj.(*v1.AppliedManifestWork), err } // Update takes the representation of a appliedManifestWork and updates it. Returns the server's representation of the appliedManifestWork, and an error, if there is any. -func (c *FakeAppliedManifestWorks) Update(ctx context.Context, appliedManifestWork *workv1.AppliedManifestWork, opts v1.UpdateOptions) (result *workv1.AppliedManifestWork, err error) { +func (c *FakeAppliedManifestWorks) Update(ctx context.Context, appliedManifestWork *v1.AppliedManifestWork, opts metav1.UpdateOptions) (result *v1.AppliedManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(appliedmanifestworksResource, appliedManifestWork), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootUpdateAction(appliedmanifestworksResource, appliedManifestWork), &v1.AppliedManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.AppliedManifestWork), err + return obj.(*v1.AppliedManifestWork), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAppliedManifestWorks) UpdateStatus(ctx context.Context, appliedManifestWork *workv1.AppliedManifestWork, opts v1.UpdateOptions) (*workv1.AppliedManifestWork, error) { +func (c *FakeAppliedManifestWorks) UpdateStatus(ctx context.Context, appliedManifestWork *v1.AppliedManifestWork, opts metav1.UpdateOptions) (*v1.AppliedManifestWork, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(appliedmanifestworksResource, "status", appliedManifestWork), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootUpdateSubresourceAction(appliedmanifestworksResource, "status", appliedManifestWork), &v1.AppliedManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.AppliedManifestWork), err + return obj.(*v1.AppliedManifestWork), err } // Delete takes name of the appliedManifestWork and deletes it. Returns an error if one occurs. -func (c *FakeAppliedManifestWorks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeAppliedManifestWorks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(appliedmanifestworksResource, name, opts), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootDeleteActionWithOptions(appliedmanifestworksResource, name, opts), &v1.AppliedManifestWork{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeAppliedManifestWorks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeAppliedManifestWorks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(appliedmanifestworksResource, listOpts) - _, err := c.Fake.Invokes(action, &workv1.AppliedManifestWorkList{}) + _, err := c.Fake.Invokes(action, &v1.AppliedManifestWorkList{}) return err } // Patch applies the patch and returns the patched appliedManifestWork. -func (c *FakeAppliedManifestWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *workv1.AppliedManifestWork, err error) { +func (c *FakeAppliedManifestWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AppliedManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(appliedmanifestworksResource, name, pt, data, subresources...), &workv1.AppliedManifestWork{}) + Invokes(testing.NewRootPatchSubresourceAction(appliedmanifestworksResource, name, pt, data, subresources...), &v1.AppliedManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.AppliedManifestWork), err + return obj.(*v1.AppliedManifestWork), err } diff --git a/client/work/clientset/versioned/typed/work/v1/fake/fake_manifestwork.go b/client/work/clientset/versioned/typed/work/v1/fake/fake_manifestwork.go index debfc1ed7..421bffc9c 100644 --- a/client/work/clientset/versioned/typed/work/v1/fake/fake_manifestwork.go +++ b/client/work/clientset/versioned/typed/work/v1/fake/fake_manifestwork.go @@ -5,13 +5,12 @@ package fake import ( "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "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" - workv1 "open-cluster-management.io/api/work/v1" + v1 "open-cluster-management.io/api/work/v1" ) // FakeManifestWorks implements ManifestWorkInterface @@ -20,25 +19,25 @@ type FakeManifestWorks struct { ns string } -var manifestworksResource = schema.GroupVersionResource{Group: "work.open-cluster-management.io", Version: "v1", Resource: "manifestworks"} +var manifestworksResource = v1.SchemeGroupVersion.WithResource("manifestworks") -var manifestworksKind = schema.GroupVersionKind{Group: "work.open-cluster-management.io", Version: "v1", Kind: "ManifestWork"} +var manifestworksKind = v1.SchemeGroupVersion.WithKind("ManifestWork") // Get takes name of the manifestWork, and returns the corresponding manifestWork object, and an error if there is any. -func (c *FakeManifestWorks) Get(ctx context.Context, name string, options v1.GetOptions) (result *workv1.ManifestWork, err error) { +func (c *FakeManifestWorks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(manifestworksResource, c.ns, name), &workv1.ManifestWork{}) + Invokes(testing.NewGetAction(manifestworksResource, c.ns, name), &v1.ManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.ManifestWork), err + return obj.(*v1.ManifestWork), err } // List takes label and field selectors, and returns the list of ManifestWorks that match those selectors. -func (c *FakeManifestWorks) List(ctx context.Context, opts v1.ListOptions) (result *workv1.ManifestWorkList, err error) { +func (c *FakeManifestWorks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ManifestWorkList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(manifestworksResource, manifestworksKind, c.ns, opts), &workv1.ManifestWorkList{}) + Invokes(testing.NewListAction(manifestworksResource, manifestworksKind, c.ns, opts), &v1.ManifestWorkList{}) if obj == nil { return nil, err @@ -48,8 +47,8 @@ func (c *FakeManifestWorks) List(ctx context.Context, opts v1.ListOptions) (resu if label == nil { label = labels.Everything() } - list := &workv1.ManifestWorkList{ListMeta: obj.(*workv1.ManifestWorkList).ListMeta} - for _, item := range obj.(*workv1.ManifestWorkList).Items { + list := &v1.ManifestWorkList{ListMeta: obj.(*v1.ManifestWorkList).ListMeta} + for _, item := range obj.(*v1.ManifestWorkList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -58,69 +57,69 @@ func (c *FakeManifestWorks) List(ctx context.Context, opts v1.ListOptions) (resu } // Watch returns a watch.Interface that watches the requested manifestWorks. -func (c *FakeManifestWorks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeManifestWorks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(manifestworksResource, c.ns, opts)) } // Create takes the representation of a manifestWork and creates it. Returns the server's representation of the manifestWork, and an error, if there is any. -func (c *FakeManifestWorks) Create(ctx context.Context, manifestWork *workv1.ManifestWork, opts v1.CreateOptions) (result *workv1.ManifestWork, err error) { +func (c *FakeManifestWorks) Create(ctx context.Context, manifestWork *v1.ManifestWork, opts metav1.CreateOptions) (result *v1.ManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(manifestworksResource, c.ns, manifestWork), &workv1.ManifestWork{}) + Invokes(testing.NewCreateAction(manifestworksResource, c.ns, manifestWork), &v1.ManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.ManifestWork), err + return obj.(*v1.ManifestWork), err } // Update takes the representation of a manifestWork and updates it. Returns the server's representation of the manifestWork, and an error, if there is any. -func (c *FakeManifestWorks) Update(ctx context.Context, manifestWork *workv1.ManifestWork, opts v1.UpdateOptions) (result *workv1.ManifestWork, err error) { +func (c *FakeManifestWorks) Update(ctx context.Context, manifestWork *v1.ManifestWork, opts metav1.UpdateOptions) (result *v1.ManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(manifestworksResource, c.ns, manifestWork), &workv1.ManifestWork{}) + Invokes(testing.NewUpdateAction(manifestworksResource, c.ns, manifestWork), &v1.ManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.ManifestWork), err + return obj.(*v1.ManifestWork), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeManifestWorks) UpdateStatus(ctx context.Context, manifestWork *workv1.ManifestWork, opts v1.UpdateOptions) (*workv1.ManifestWork, error) { +func (c *FakeManifestWorks) UpdateStatus(ctx context.Context, manifestWork *v1.ManifestWork, opts metav1.UpdateOptions) (*v1.ManifestWork, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(manifestworksResource, "status", c.ns, manifestWork), &workv1.ManifestWork{}) + Invokes(testing.NewUpdateSubresourceAction(manifestworksResource, "status", c.ns, manifestWork), &v1.ManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.ManifestWork), err + return obj.(*v1.ManifestWork), err } // Delete takes name of the manifestWork and deletes it. Returns an error if one occurs. -func (c *FakeManifestWorks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeManifestWorks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(manifestworksResource, c.ns, name, opts), &workv1.ManifestWork{}) + Invokes(testing.NewDeleteActionWithOptions(manifestworksResource, c.ns, name, opts), &v1.ManifestWork{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeManifestWorks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeManifestWorks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(manifestworksResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &workv1.ManifestWorkList{}) + _, err := c.Fake.Invokes(action, &v1.ManifestWorkList{}) return err } // Patch applies the patch and returns the patched manifestWork. -func (c *FakeManifestWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *workv1.ManifestWork, err error) { +func (c *FakeManifestWorks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManifestWork, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(manifestworksResource, c.ns, name, pt, data, subresources...), &workv1.ManifestWork{}) + Invokes(testing.NewPatchSubresourceAction(manifestworksResource, c.ns, name, pt, data, subresources...), &v1.ManifestWork{}) if obj == nil { return nil, err } - return obj.(*workv1.ManifestWork), err + return obj.(*v1.ManifestWork), err } diff --git a/client/work/clientset/versioned/typed/work/v1alpha1/fake/fake_manifestworkreplicaset.go b/client/work/clientset/versioned/typed/work/v1alpha1/fake/fake_manifestworkreplicaset.go index a58142312..fef1462b8 100644 --- a/client/work/clientset/versioned/typed/work/v1alpha1/fake/fake_manifestworkreplicaset.go +++ b/client/work/clientset/versioned/typed/work/v1alpha1/fake/fake_manifestworkreplicaset.go @@ -7,7 +7,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" @@ -20,9 +19,9 @@ type FakeManifestWorkReplicaSets struct { ns string } -var manifestworkreplicasetsResource = schema.GroupVersionResource{Group: "work.open-cluster-management.io", Version: "v1alpha1", Resource: "manifestworkreplicasets"} +var manifestworkreplicasetsResource = v1alpha1.SchemeGroupVersion.WithResource("manifestworkreplicasets") -var manifestworkreplicasetsKind = schema.GroupVersionKind{Group: "work.open-cluster-management.io", Version: "v1alpha1", Kind: "ManifestWorkReplicaSet"} +var manifestworkreplicasetsKind = v1alpha1.SchemeGroupVersion.WithKind("ManifestWorkReplicaSet") // Get takes name of the manifestWorkReplicaSet, and returns the corresponding manifestWorkReplicaSet object, and an error if there is any. func (c *FakeManifestWorkReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManifestWorkReplicaSet, err error) { diff --git a/client/work/informers/externalversions/factory.go b/client/work/informers/externalversions/factory.go index 38394a2c9..3f0bd0671 100644 --- a/client/work/informers/externalversions/factory.go +++ b/client/work/informers/externalversions/factory.go @@ -150,7 +150,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -223,7 +223,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/cluster/v1/doc.go b/cluster/v1/doc.go index 8e2eaea79..d877cde08 100644 --- a/cluster/v1/doc.go +++ b/cluster/v1/doc.go @@ -1,7 +1,5 @@ // Package v1 contains API Schema definitions for the cluster v1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/cluster -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/cluster/v1alpha1/doc.go b/cluster/v1alpha1/doc.go index 28765f356..93f37581c 100644 --- a/cluster/v1alpha1/doc.go +++ b/cluster/v1alpha1/doc.go @@ -1,7 +1,5 @@ // Package v1alpha1 contains API Schema definitions for the cluster v1alpha1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/cluster -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/cluster/v1beta1/doc.go b/cluster/v1beta1/doc.go index 16e016287..222d49af3 100644 --- a/cluster/v1beta1/doc.go +++ b/cluster/v1beta1/doc.go @@ -1,7 +1,5 @@ // Package v1beta1 contains API Schema definitions for the cluster v1beta1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/cluster -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/cluster/v1beta2/doc.go b/cluster/v1beta2/doc.go index 105f7e834..28e6834b1 100644 --- a/cluster/v1beta2/doc.go +++ b/cluster/v1beta2/doc.go @@ -1,7 +1,5 @@ // Package v1beta2 contains API Schema definitions for the cluster v1beta2 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/cluster -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 8d4b01dbd..70e7e0162 100644 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -30,3 +30,10 @@ open-cluster-management.io/api/work/v1alpha1,\ open-cluster-management.io/api/operator/v1,\ open-cluster-management.io/api/addon/v1alpha1\ " + +set -x + +SED_CMD=sed +if [[ `uname` == 'Darwin' ]]; then + SED_CMD=gsed +fi diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index ac2a1b2d2..f27a9831e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -1,27 +1,25 @@ #!/bin/bash -set -o errexit -set -o nounset -set -o pipefail +# the path of this repo should be go/src/open-cluster-management.io/api which is set in kube-codegen. + +source "$(dirname "${BASH_SOURCE}")/lib/init.sh" SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)} verify="${VERIFY:-}" -set -x +# HACK: For some reason this script is not executable. +${SED_CMD} -i 's,^exec \(.*/generate-internal-groups.sh\),bash \1,g' ${CODEGEN_PKG}/generate-groups.sh # Because go mod sux, we have to fake the vendor for generator in order to be able to build it... -mv ${CODEGEN_PKG}/kube_codegen.sh ${CODEGEN_PKG}/kube_codegen.sh.orig -sed 's/GO111MODULE=on go install/#GO111MODULE=on go install/g' ${CODEGEN_PKG}/kube_codegen.sh.orig > ${CODEGEN_PKG}/kube_codegen.sh -function cleanup { - mv ${CODEGEN_PKG}/kube_codegen.sh.orig ${CODEGEN_PKG}/kube_codegen.sh -} -trap cleanup EXIT +${SED_CMD} -i 's/GO111MODULE=on go install/#GO111MODULE=on go install/g' ${CODEGEN_PKG}/generate-internal-groups.sh +# ...but we have to put it back, or `verify` will puke. +trap "git checkout ${CODEGEN_PKG}" EXIT go install -mod=vendor ./${CODEGEN_PKG}/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} for group in cluster; do - bash ${CODEGEN_PKG}/kube_codegen.sh "client,lister,informer" \ + bash ${CODEGEN_PKG}/generate-groups.sh "client,lister,informer" \ open-cluster-management.io/api/client/${group} \ open-cluster-management.io/api \ "${group}:v1,v1alpha1,v1beta1,v1beta2" \ @@ -30,7 +28,7 @@ for group in cluster; do done for group in work; do - bash ${CODEGEN_PKG}/kube_codegen.sh "client,lister,informer" \ + bash ${CODEGEN_PKG}/generate-groups.sh "client,lister,informer" \ open-cluster-management.io/api/client/${group} \ open-cluster-management.io/api \ "${group}:v1,v1alpha1" \ @@ -39,7 +37,7 @@ for group in work; do done for group in operator; do - bash ${CODEGEN_PKG}/kube_codegen.sh "client,lister,informer" \ + bash ${CODEGEN_PKG}/generate-groups.sh "client,lister,informer" \ open-cluster-management.io/api/client/${group} \ open-cluster-management.io/api \ "${group}:v1" \ @@ -48,7 +46,7 @@ for group in operator; do done for group in addon; do - bash ${CODEGEN_PKG}/kube_codegen.sh "client,lister,informer" \ + bash ${CODEGEN_PKG}/generate-groups.sh "client,lister,informer" \ open-cluster-management.io/api/client/${group} \ open-cluster-management.io/api \ "${group}:v1alpha1" \ diff --git a/hack/update-deepcopy.sh b/hack/update-deepcopy.sh index 04d1360a8..57a75458d 100755 --- a/hack/update-deepcopy.sh +++ b/hack/update-deepcopy.sh @@ -1,18 +1,26 @@ #!/bin/bash +# the path of this repo should be go/src/open-cluster-management.io/api which is set in kube-codegen. + source "$(dirname "${BASH_SOURCE}")/lib/init.sh" SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)} -verify="${VERIFY:-}" +source "${CODEGEN_PKG}/kube_codegen.sh" + +for group in operator work addon; do +kube::codegen::gen_helpers \ + --input-pkg-root open-cluster-management.io/api/${group} \ + --output-base "${SCRIPT_ROOT}/../.." \ + --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.txt" +done -# cluster:v1alpha1 is generated in the Makefile target 'update-scripts' using controller-gen -# because gengo isn't respecting deepcopy-gen:false nor does it support generics -# Issue: https://github.com/kubernetes/gengo/issues/225 -GOFLAGS="" bash ${CODEGEN_PKG}/kube_codegen.sh "deepcopy" \ - open-cluster-management.io/api/generated \ - open-cluster-management.io/api \ - "cluster:v1 cluster:v1beta1 cluster:v1beta2 work:v1alpha1 work:v1 operator:v1 addon:v1alpha1" \ - --go-header-file ${SCRIPT_ROOT}/hack/empty.txt \ - ${verify} +# skip cluster/v1alpha1 since failed to handle ClusterRolloutStatusFunc RolloutHandler in helper.go +# TODO: will added back until helper.go is removed. +for version in v1 v1beta1 v1beta2; do +kube::codegen::gen_helpers \ + --input-pkg-root open-cluster-management.io/api/cluster/${version} \ + --output-base "${SCRIPT_ROOT}/../.." \ + --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.txt" +done diff --git a/operator/v1/doc.go b/operator/v1/doc.go index d2fe07aec..48ecda241 100644 --- a/operator/v1/doc.go +++ b/operator/v1/doc.go @@ -1,7 +1,5 @@ // Package v1 contains API Schema definitions for the operator v1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/operator -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/operator/v1/types_clustermanager.go b/operator/v1/types_clustermanager.go index e833fa7bf..ed97ffd4c 100644 --- a/operator/v1/types_clustermanager.go +++ b/operator/v1/types_clustermanager.go @@ -175,7 +175,6 @@ type WebhookConfiguration struct { // Port represents the port of a webhook-server. The default value of Port is 443. // +optional - // +default=443 // +kubebuilder:default=443 // +kubebuilder:validation:Maximum=65535 Port int32 `json:"port,omitempty"` @@ -190,7 +189,6 @@ type ClusterManagerDeployOption struct { // of hub-cluster with cluster-admin permission). // Note: Do not modify the Mode field once it's applied. // +required - // +default=Default // +kubebuilder:validation:Required // +kubebuilder:default=Default // +kubebuilder:validation:Enum=Default;Hosted diff --git a/work/v1/doc.go b/work/v1/doc.go index 9349a3526..2e1779f4c 100644 --- a/work/v1/doc.go +++ b/work/v1/doc.go @@ -1,7 +1,5 @@ // Package v1 contains API Schema definitions for the work v1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/work -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional diff --git a/work/v1alpha1/doc.go b/work/v1alpha1/doc.go index 0980bcb02..c6c5547f4 100644 --- a/work/v1alpha1/doc.go +++ b/work/v1alpha1/doc.go @@ -1,7 +1,5 @@ // Package v1 contains API Schema definitions for the work v1 API group // +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=open-cluster-management.io/api/work -// +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true // +kubebuilder:validation:Optional