From c74a7ec1b976a23e8eb73ffc5904d63230a7d24b Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Tue, 26 Sep 2023 09:44:15 +0200 Subject: [PATCH 1/3] Upgrade code-generator to version v0.27.2 --- Makefile | 24 ++---- pkg/client/clientset/versioned/clientset.go | 44 ++++++++--- pkg/client/clientset/versioned/doc.go | 20 ----- .../versioned/fake/clientset_generated.go | 5 +- .../controller/v1beta1/controller_client.go | 20 ++++- .../v1beta1/fake/fake_appwrapper.go | 7 +- .../quotasubtree/v1/fake/fake_quotasubtree.go | 57 +++++++------ .../quotasubtree/v1/quotasubtree_client.go | 20 ++++- .../informers/externalversions/factory.go | 79 ++++++++++++++++++- 9 files changed, 188 insertions(+), 88 deletions(-) delete mode 100644 pkg/client/clientset/versioned/doc.go diff --git a/Makefile b/Makefile index c1e8ec7c9..693144df3 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ $(LOCALBIN): ## Tool Versions CONTROLLER_TOOLS_VERSION ?= v0.9.2 -CODEGEN_VERSION ?= v0.20.15 +CODEGEN_VERSION ?= v0.27.2 ## Tool Binaries CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen @@ -83,17 +83,15 @@ generate-client: code-generator --go-header-file="hack/boilerplate/boilerplate.go.txt" \ --clientset-name "versioned" \ --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset" \ - --output-base="." -# TODO: add the following line back once the tool has been upgraded -# --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" + --output-base="." \ + --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(LISTER_GEN) \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ --output-base="." \ - --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers" -# TODO: add the following line back once the tool has been upgraded -# --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" + --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers" \ + --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(INFORMER_GEN) \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" \ @@ -101,16 +99,8 @@ generate-client: code-generator --listers-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ --output-base="." \ - --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers" -# TODO: add the following line back once the tool has been upgraded -# --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" -# TODO: remove the following lines once the tool has been upgraded and they are no longer needed. -# The `mv` and `rm` are necessary as the generators write to the gihub.com/... path. - mv -f github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned pkg/client/clientset/versioned - mv -f github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions pkg/client/informers/externalversions - mv -f github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/controller/v1beta1 pkg/client/listers/controller/v1beta1 - mv -f github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/quotasubtree/v1 pkg/client/listers/quotasubtree/v1 - rm -rf github.com + --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers" \ + --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 768fcdf94..373f90897 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,6 +20,7 @@ package versioned import ( "fmt" + "net/http" workloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/controller/v1beta1" quotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1" @@ -34,8 +35,7 @@ type Interface interface { QuotaV1() quotav1.QuotaV1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient workloadV1beta1 *workloadv1beta1.WorkloadV1beta1Client @@ -63,26 +63,49 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { // NewForConfig creates a new Clientset for the given config. // If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } + var cs Clientset var err error - cs.workloadV1beta1, err = workloadv1beta1.NewForConfig(&configShallowCopy) + cs.workloadV1beta1, err = workloadv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.quotaV1, err = quotav1.NewForConfig(&configShallowCopy) + cs.quotaV1, err = quotav1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -92,12 +115,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // NewForConfigOrDie creates a new Clientset for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.workloadV1beta1 = workloadv1beta1.NewForConfigOrDie(c) - cs.quotaV1 = quotav1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs } // New creates a new Clientset for the given RESTClient. diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go deleted file mode 100644 index bab04ec55..000000000 --- a/pkg/client/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 5fc7acd1d..c0bc5b594 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -76,7 +76,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } -var _ clientset.Interface = &Clientset{} +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) // WorkloadV1beta1 retrieves the WorkloadV1beta1Client func (c *Clientset) WorkloadV1beta1() workloadv1beta1.WorkloadV1beta1Interface { diff --git a/pkg/client/clientset/versioned/typed/controller/v1beta1/controller_client.go b/pkg/client/clientset/versioned/typed/controller/v1beta1/controller_client.go index d1f6e18f8..52f63f94a 100644 --- a/pkg/client/clientset/versioned/typed/controller/v1beta1/controller_client.go +++ b/pkg/client/clientset/versioned/typed/controller/v1beta1/controller_client.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "net/http" + v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" @@ -39,12 +41,28 @@ func (c *WorkloadV1beta1Client) AppWrappers(namespace string) AppWrapperInterfac } // NewForConfig creates a new WorkloadV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*WorkloadV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } - client, err := rest.RESTClientFor(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new WorkloadV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*WorkloadV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } diff --git a/pkg/client/clientset/versioned/typed/controller/v1beta1/fake/fake_appwrapper.go b/pkg/client/clientset/versioned/typed/controller/v1beta1/fake/fake_appwrapper.go index b62e4ce2e..dda5f0d46 100644 --- a/pkg/client/clientset/versioned/typed/controller/v1beta1/fake/fake_appwrapper.go +++ b/pkg/client/clientset/versioned/typed/controller/v1beta1/fake/fake_appwrapper.go @@ -24,7 +24,6 @@ import ( v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" 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 FakeAppWrappers struct { ns string } -var appwrappersResource = schema.GroupVersionResource{Group: "workload.codeflare.dev", Version: "v1beta1", Resource: "appwrappers"} +var appwrappersResource = v1beta1.SchemeGroupVersion.WithResource("appwrappers") -var appwrappersKind = schema.GroupVersionKind{Group: "workload.codeflare.dev", Version: "v1beta1", Kind: "AppWrapper"} +var appwrappersKind = v1beta1.SchemeGroupVersion.WithKind("AppWrapper") // Get takes name of the appWrapper, and returns the corresponding appWrapper object, and an error if there is any. func (c *FakeAppWrappers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AppWrapper, err error) { @@ -117,7 +116,7 @@ func (c *FakeAppWrappers) UpdateStatus(ctx context.Context, appWrapper *v1beta1. // Delete takes name of the appWrapper and deletes it. Returns an error if one occurs. func (c *FakeAppWrappers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(appwrappersResource, c.ns, name), &v1beta1.AppWrapper{}) + Invokes(testing.NewDeleteActionWithOptions(appwrappersResource, c.ns, name, opts), &v1beta1.AppWrapper{}) return err } diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go index 734cda544..5ff92dca4 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go @@ -21,10 +21,9 @@ package fake import ( "context" - quotasubtreev1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/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" @@ -36,25 +35,25 @@ type FakeQuotaSubtrees struct { ns string } -var quotasubtreesResource = schema.GroupVersionResource{Group: "quota.codeflare.dev", Version: "v1", Resource: "quotasubtrees"} +var quotasubtreesResource = v1.SchemeGroupVersion.WithResource("quotasubtrees") -var quotasubtreesKind = schema.GroupVersionKind{Group: "quota.codeflare.dev", Version: "v1", Kind: "QuotaSubtree"} +var quotasubtreesKind = v1.SchemeGroupVersion.WithKind("QuotaSubtree") // Get takes name of the quotaSubtree, and returns the corresponding quotaSubtree object, and an error if there is any. -func (c *FakeQuotaSubtrees) Get(ctx context.Context, name string, options v1.GetOptions) (result *quotasubtreev1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(quotasubtreesResource, c.ns, name), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewGetAction(quotasubtreesResource, c.ns, name), &v1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*quotasubtreev1.QuotaSubtree), err + return obj.(*v1.QuotaSubtree), err } // List takes label and field selectors, and returns the list of QuotaSubtrees that match those selectors. -func (c *FakeQuotaSubtrees) List(ctx context.Context, opts v1.ListOptions) (result *quotasubtreev1.QuotaSubtreeList, err error) { +func (c *FakeQuotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) (result *v1.QuotaSubtreeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(quotasubtreesResource, quotasubtreesKind, c.ns, opts), "asubtreev1.QuotaSubtreeList{}) + Invokes(testing.NewListAction(quotasubtreesResource, quotasubtreesKind, c.ns, opts), &v1.QuotaSubtreeList{}) if obj == nil { return nil, err @@ -64,8 +63,8 @@ func (c *FakeQuotaSubtrees) List(ctx context.Context, opts v1.ListOptions) (resu if label == nil { label = labels.Everything() } - list := "asubtreev1.QuotaSubtreeList{ListMeta: obj.(*quotasubtreev1.QuotaSubtreeList).ListMeta} - for _, item := range obj.(*quotasubtreev1.QuotaSubtreeList).Items { + list := &v1.QuotaSubtreeList{ListMeta: obj.(*v1.QuotaSubtreeList).ListMeta} + for _, item := range obj.(*v1.QuotaSubtreeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -74,69 +73,69 @@ func (c *FakeQuotaSubtrees) List(ctx context.Context, opts v1.ListOptions) (resu } // Watch returns a watch.Interface that watches the requested quotaSubtrees. -func (c *FakeQuotaSubtrees) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeQuotaSubtrees) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(quotasubtreesResource, c.ns, opts)) } // Create takes the representation of a quotaSubtree and creates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *FakeQuotaSubtrees) Create(ctx context.Context, quotaSubtree *quotasubtreev1.QuotaSubtree, opts v1.CreateOptions) (result *quotasubtreev1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Create(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.CreateOptions) (result *v1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(quotasubtreesResource, c.ns, quotaSubtree), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewCreateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*quotasubtreev1.QuotaSubtree), err + return obj.(*v1.QuotaSubtree), err } // Update takes the representation of a quotaSubtree and updates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *FakeQuotaSubtrees) Update(ctx context.Context, quotaSubtree *quotasubtreev1.QuotaSubtree, opts v1.UpdateOptions) (result *quotasubtreev1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Update(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (result *v1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(quotasubtreesResource, c.ns, quotaSubtree), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewUpdateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*quotasubtreev1.QuotaSubtree), err + return obj.(*v1.QuotaSubtree), 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 *FakeQuotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *quotasubtreev1.QuotaSubtree, opts v1.UpdateOptions) (*quotasubtreev1.QuotaSubtree, error) { +func (c *FakeQuotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (*v1.QuotaSubtree, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(quotasubtreesResource, "status", c.ns, quotaSubtree), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewUpdateSubresourceAction(quotasubtreesResource, "status", c.ns, quotaSubtree), &v1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*quotasubtreev1.QuotaSubtree), err + return obj.(*v1.QuotaSubtree), err } // Delete takes name of the quotaSubtree and deletes it. Returns an error if one occurs. -func (c *FakeQuotaSubtrees) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeQuotaSubtrees) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(quotasubtreesResource, c.ns, name), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewDeleteActionWithOptions(quotasubtreesResource, c.ns, name, opts), &v1.QuotaSubtree{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeQuotaSubtrees) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeQuotaSubtrees) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(quotasubtreesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, "asubtreev1.QuotaSubtreeList{}) + _, err := c.Fake.Invokes(action, &v1.QuotaSubtreeList{}) return err } // Patch applies the patch and returns the patched quotaSubtree. -func (c *FakeQuotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *quotasubtreev1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(quotasubtreesResource, c.ns, name, pt, data, subresources...), "asubtreev1.QuotaSubtree{}) + Invokes(testing.NewPatchSubresourceAction(quotasubtreesResource, c.ns, name, pt, data, subresources...), &v1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*quotasubtreev1.QuotaSubtree), err + return obj.(*v1.QuotaSubtree), err } diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go index 6db1d71ee..3cf172cfa 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "net/http" + v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" @@ -39,12 +41,28 @@ func (c *QuotaV1Client) QuotaSubtrees(namespace string) QuotaSubtreeInterface { } // NewForConfig creates a new QuotaV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*QuotaV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } - client, err := rest.RESTClientFor(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new QuotaV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*QuotaV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 2cc4c0e47..252155b77 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -48,6 +48,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -108,20 +113,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -168,11 +192,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // 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 + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Workload() controller.Interface Quota() quotasubtree.Interface } From 4c3c2f5d7121cfae4ebdc7a07dd003ef72c7a6a8 Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Tue, 26 Sep 2023 09:47:23 +0200 Subject: [PATCH 2/3] Generate apply configuration --- Makefile | 27 +- .../controller/v1beta1/appwrapper.go | 219 +++++++++++++++ .../controller/v1beta1/appwrappercondition.go | 90 +++++++ .../v1beta1/appwrappergenericresource.go | 111 ++++++++ .../v1beta1/appwrapperresourcelist.go | 44 +++ .../controller/v1beta1/appwrapperservice.go | 43 +++ .../controller/v1beta1/appwrapperspec.go | 88 ++++++ .../controller/v1beta1/appwrapperstatus.go | 252 ++++++++++++++++++ .../v1beta1/custompodresourcetemplate.go | 61 +++++ .../v1beta1/dispatchdurationspec.go | 57 ++++ .../controller/v1beta1/pendingpodspec.go | 54 ++++ .../controller/v1beta1/requeuingtemplate.go | 84 ++++++ .../v1beta1/schedulingspectemplate.go | 72 +++++ .../applyconfiguration/internal/internal.go | 62 +++++ pkg/client/applyconfiguration/utils.go | 59 ++++ 15 files changed, 1308 insertions(+), 15 deletions(-) create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrapper.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrappercondition.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrappergenericresource.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrapperresourcelist.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrapperservice.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrapperspec.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/appwrapperstatus.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/custompodresourcetemplate.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/dispatchdurationspec.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/pendingpodspec.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/requeuingtemplate.go create mode 100644 pkg/client/applyconfiguration/controller/v1beta1/schedulingspectemplate.go create mode 100644 pkg/client/applyconfiguration/internal/internal.go create mode 100644 pkg/client/applyconfiguration/utils.go diff --git a/Makefile b/Makefile index 693144df3..649517bfe 100644 --- a/Makefile +++ b/Makefile @@ -69,13 +69,12 @@ verify-tag-name: print-global-variables t=${TAG} && [ $${#t} -le 128 ] || { echo "Target name $$t has 128 or more chars"; false; } .PHONY: generate-client ## Generate client packages generate-client: code-generator - rm -rf pkg/client/clientset/versioned pkg/client/informers/externalversions pkg/client/listers/controller/v1beta1 pkg/client/listers/quotasubtree/v1 -# TODO: add this back when the version of the tool has been updated and supports this executable -# $(APPLYCONFIGURATION_GEN) \ -# --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ -# --go-header-file="hack/boilerplate/boilerplate.go.txt" \ -# --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/applyconfiguration" \ -# --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" + rm -rf pkg/client/applyconfiguration pkg/client/clientset/versioned pkg/client/informers/externalversions pkg/client/listers/controller/v1beta1 pkg/client/listers/quotasubtree/v1 + $(APPLYCONFIGURATION_GEN) \ + --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ + --go-header-file="hack/boilerplate/boilerplate.go.txt" \ + --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/applyconfiguration" \ + --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(CLIENT_GEN) \ --input="pkg/apis/controller/v1beta1" \ --input="pkg/apis/quotaplugins/quotasubtree/v1" \ @@ -108,14 +107,12 @@ $(CONTROLLER_GEN): $(LOCALBIN) test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) .PHONY: code-generator -#TODO: add $(APPLYCONFIGURATION_GEN) as a dependency when the tool is supported -code-generator: $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(CONTROLLER_GEN) - -# TODO: enable this target once the tools is supported -#.PHONY: applyconfiguration-gen -#applyconfiguration-gen: $(APPLYCONFIGURATION_GEN) -#$(APPLYCONFIGURATION_GEN): $(LOCALBIN) -# test -s $(LOCALBIN)/applyconfiguration-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION) +code-generator: $(APPLYCONFIGURATION_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN) $(CONTROLLER_GEN) + +.PHONY: applyconfiguration-gen +applyconfiguration-gen: $(APPLYCONFIGURATION_GEN) +$(APPLYCONFIGURATION_GEN): $(LOCALBIN) + test -s $(LOCALBIN)/applyconfiguration-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION) .PHONY: client-gen client-gen: $(CLIENT_GEN) diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrapper.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrapper.go new file mode 100644 index 000000000..1f2493dab --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrapper.go @@ -0,0 +1,219 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AppWrapperApplyConfiguration represents an declarative configuration of the AppWrapper type for use +// with apply. +type AppWrapperApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *AppWrapperSpecApplyConfiguration `json:"spec,omitempty"` + Status *AppWrapperStatusApplyConfiguration `json:"status,omitempty"` +} + +// AppWrapper constructs an declarative configuration of the AppWrapper type for use with +// apply. +func AppWrapper(name, namespace string) *AppWrapperApplyConfiguration { + b := &AppWrapperApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("AppWrapper") + b.WithAPIVersion("workload.codeflare.dev/v1beta1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithKind(value string) *AppWrapperApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithAPIVersion(value string) *AppWrapperApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithName(value string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithGenerateName(value string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithNamespace(value string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithUID(value types.UID) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithResourceVersion(value string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithGeneration(value int64) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AppWrapperApplyConfiguration) WithLabels(entries map[string]string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AppWrapperApplyConfiguration) WithAnnotations(entries map[string]string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *AppWrapperApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *AppWrapperApplyConfiguration) WithFinalizers(values ...string) *AppWrapperApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *AppWrapperApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithSpec(value *AppWrapperSpecApplyConfiguration) *AppWrapperApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *AppWrapperApplyConfiguration) WithStatus(value *AppWrapperStatusApplyConfiguration) *AppWrapperApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrappercondition.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrappercondition.go new file mode 100644 index 000000000..5a6f59c04 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrappercondition.go @@ -0,0 +1,90 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AppWrapperConditionApplyConfiguration represents an declarative configuration of the AppWrapperCondition type for use +// with apply. +type AppWrapperConditionApplyConfiguration struct { + Type *v1beta1.AppWrapperConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastUpdateMicroTime *metav1.MicroTime `json:"lastUpdateMicroTime,omitempty"` + LastTransitionMicroTime *metav1.MicroTime `json:"lastTransitionMicroTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// AppWrapperConditionApplyConfiguration constructs an declarative configuration of the AppWrapperCondition type for use with +// apply. +func AppWrapperCondition() *AppWrapperConditionApplyConfiguration { + return &AppWrapperConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithType(value v1beta1.AppWrapperConditionType) *AppWrapperConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *AppWrapperConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastUpdateMicroTime sets the LastUpdateMicroTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdateMicroTime field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithLastUpdateMicroTime(value metav1.MicroTime) *AppWrapperConditionApplyConfiguration { + b.LastUpdateMicroTime = &value + return b +} + +// WithLastTransitionMicroTime sets the LastTransitionMicroTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionMicroTime field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithLastTransitionMicroTime(value metav1.MicroTime) *AppWrapperConditionApplyConfiguration { + b.LastTransitionMicroTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithReason(value string) *AppWrapperConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *AppWrapperConditionApplyConfiguration) WithMessage(value string) *AppWrapperConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrappergenericresource.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrappergenericresource.go new file mode 100644 index 000000000..a8d6f8490 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrappergenericresource.go @@ -0,0 +1,111 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// AppWrapperGenericResourceApplyConfiguration represents an declarative configuration of the AppWrapperGenericResource type for use +// with apply. +type AppWrapperGenericResourceApplyConfiguration struct { + DesiredAvailable *int32 `json:"replicas,omitempty"` + MinAvailable *int32 `json:"minavailable,omitempty"` + Allocated *int32 `json:"allocated,omitempty"` + Priority *int32 `json:"priority,omitempty"` + PrioritySlope *float64 `json:"priorityslope,omitempty"` + GenericTemplate *runtime.RawExtension `json:"generictemplate,omitempty"` + CustomPodResources []CustomPodResourceTemplateApplyConfiguration `json:"custompodresources,omitempty"` + CompletionStatus *string `json:"completionstatus,omitempty"` +} + +// AppWrapperGenericResourceApplyConfiguration constructs an declarative configuration of the AppWrapperGenericResource type for use with +// apply. +func AppWrapperGenericResource() *AppWrapperGenericResourceApplyConfiguration { + return &AppWrapperGenericResourceApplyConfiguration{} +} + +// WithDesiredAvailable sets the DesiredAvailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredAvailable field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithDesiredAvailable(value int32) *AppWrapperGenericResourceApplyConfiguration { + b.DesiredAvailable = &value + return b +} + +// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinAvailable field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithMinAvailable(value int32) *AppWrapperGenericResourceApplyConfiguration { + b.MinAvailable = &value + return b +} + +// WithAllocated sets the Allocated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Allocated field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithAllocated(value int32) *AppWrapperGenericResourceApplyConfiguration { + b.Allocated = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithPriority(value int32) *AppWrapperGenericResourceApplyConfiguration { + b.Priority = &value + return b +} + +// WithPrioritySlope sets the PrioritySlope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PrioritySlope field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithPrioritySlope(value float64) *AppWrapperGenericResourceApplyConfiguration { + b.PrioritySlope = &value + return b +} + +// WithGenericTemplate sets the GenericTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenericTemplate field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithGenericTemplate(value runtime.RawExtension) *AppWrapperGenericResourceApplyConfiguration { + b.GenericTemplate = &value + return b +} + +// WithCustomPodResources adds the given value to the CustomPodResources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CustomPodResources field. +func (b *AppWrapperGenericResourceApplyConfiguration) WithCustomPodResources(values ...*CustomPodResourceTemplateApplyConfiguration) *AppWrapperGenericResourceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCustomPodResources") + } + b.CustomPodResources = append(b.CustomPodResources, *values[i]) + } + return b +} + +// WithCompletionStatus sets the CompletionStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CompletionStatus field is set to the value of the last call. +func (b *AppWrapperGenericResourceApplyConfiguration) WithCompletionStatus(value string) *AppWrapperGenericResourceApplyConfiguration { + b.CompletionStatus = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrapperresourcelist.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperresourcelist.go new file mode 100644 index 000000000..bd1300023 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperresourcelist.go @@ -0,0 +1,44 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// AppWrapperResourceListApplyConfiguration represents an declarative configuration of the AppWrapperResourceList type for use +// with apply. +type AppWrapperResourceListApplyConfiguration struct { + GenericItems []AppWrapperGenericResourceApplyConfiguration `json:"GenericItems,omitempty"` +} + +// AppWrapperResourceListApplyConfiguration constructs an declarative configuration of the AppWrapperResourceList type for use with +// apply. +func AppWrapperResourceList() *AppWrapperResourceListApplyConfiguration { + return &AppWrapperResourceListApplyConfiguration{} +} + +// WithGenericItems adds the given value to the GenericItems field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the GenericItems field. +func (b *AppWrapperResourceListApplyConfiguration) WithGenericItems(values ...*AppWrapperGenericResourceApplyConfiguration) *AppWrapperResourceListApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithGenericItems") + } + b.GenericItems = append(b.GenericItems, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrapperservice.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperservice.go new file mode 100644 index 000000000..afed9fffa --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperservice.go @@ -0,0 +1,43 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// AppWrapperServiceApplyConfiguration represents an declarative configuration of the AppWrapperService type for use +// with apply. +type AppWrapperServiceApplyConfiguration struct { + Spec *v1.ServiceSpec `json:"spec,omitempty"` +} + +// AppWrapperServiceApplyConfiguration constructs an declarative configuration of the AppWrapperService type for use with +// apply. +func AppWrapperService() *AppWrapperServiceApplyConfiguration { + return &AppWrapperServiceApplyConfiguration{} +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AppWrapperServiceApplyConfiguration) WithSpec(value v1.ServiceSpec) *AppWrapperServiceApplyConfiguration { + b.Spec = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrapperspec.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperspec.go new file mode 100644 index 000000000..8e81f80f2 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperspec.go @@ -0,0 +1,88 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AppWrapperSpecApplyConfiguration represents an declarative configuration of the AppWrapperSpec type for use +// with apply. +type AppWrapperSpecApplyConfiguration struct { + Priority *int32 `json:"priority,omitempty"` + PrioritySlope *float64 `json:"priorityslope,omitempty"` + Service *AppWrapperServiceApplyConfiguration `json:"service,omitempty"` + AggrResources *AppWrapperResourceListApplyConfiguration `json:"resources,omitempty"` + Selector *v1.LabelSelector `json:"selector,omitempty"` + SchedSpec *SchedulingSpecTemplateApplyConfiguration `json:"schedulingSpec,omitempty"` +} + +// AppWrapperSpecApplyConfiguration constructs an declarative configuration of the AppWrapperSpec type for use with +// apply. +func AppWrapperSpec() *AppWrapperSpecApplyConfiguration { + return &AppWrapperSpecApplyConfiguration{} +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithPriority(value int32) *AppWrapperSpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithPrioritySlope sets the PrioritySlope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PrioritySlope field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithPrioritySlope(value float64) *AppWrapperSpecApplyConfiguration { + b.PrioritySlope = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithService(value *AppWrapperServiceApplyConfiguration) *AppWrapperSpecApplyConfiguration { + b.Service = value + return b +} + +// WithAggrResources sets the AggrResources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AggrResources field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithAggrResources(value *AppWrapperResourceListApplyConfiguration) *AppWrapperSpecApplyConfiguration { + b.AggrResources = value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithSelector(value v1.LabelSelector) *AppWrapperSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithSchedSpec sets the SchedSpec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedSpec field is set to the value of the last call. +func (b *AppWrapperSpecApplyConfiguration) WithSchedSpec(value *SchedulingSpecTemplateApplyConfiguration) *AppWrapperSpecApplyConfiguration { + b.SchedSpec = value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/appwrapperstatus.go b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperstatus.go new file mode 100644 index 000000000..d594619d8 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/appwrapperstatus.go @@ -0,0 +1,252 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AppWrapperStatusApplyConfiguration represents an declarative configuration of the AppWrapperStatus type for use +// with apply. +type AppWrapperStatusApplyConfiguration struct { + Pending *int32 `json:"pending,omitempty"` + Running *int32 `json:"running,omitempty"` + Succeeded *int32 `json:"Succeeded,omitempty"` + Failed *int32 `json:"failed,omitempty"` + MinAvailable *int32 `json:"template,omitempty"` + CanRun *bool `json:"canrun,omitempty"` + IsDispatched *bool `json:"isdispatched,omitempty"` + State *v1beta1.AppWrapperState `json:"state,omitempty"` + Message *string `json:"message,omitempty"` + SystemPriority *float64 `json:"systempriority,omitempty"` + QueueJobState *v1beta1.AppWrapperConditionType `json:"queuejobstate,omitempty"` + ControllerFirstTimestamp *v1.MicroTime `json:"controllerfirsttimestamp,omitempty"` + ControllerFirstDispatchTimestamp *v1.MicroTime `json:"controllerfirstdispatchtimestamp,omitempty"` + FilterIgnore *bool `json:"filterignore,omitempty"` + Sender *string `json:"sender,omitempty"` + Local *bool `json:"local,omitempty"` + Conditions []AppWrapperConditionApplyConfiguration `json:"conditions,omitempty"` + PendingPodConditions []PendingPodSpecApplyConfiguration `json:"pendingpodconditions,omitempty"` + TotalCPU *int32 `json:"totalcpu,omitempty"` + TotalMemory *int32 `json:"totalmemory,omitempty"` + TotalGPU *int32 `json:"totalgpu,omitempty"` + RequeueingTimeInSeconds *int `json:"requeueingTimeInSeconds,omitempty"` + NumberOfRequeueings *int `json:"numberOfRequeueings,omitempty"` +} + +// AppWrapperStatusApplyConfiguration constructs an declarative configuration of the AppWrapperStatus type for use with +// apply. +func AppWrapperStatus() *AppWrapperStatusApplyConfiguration { + return &AppWrapperStatusApplyConfiguration{} +} + +// WithPending sets the Pending field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pending field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithPending(value int32) *AppWrapperStatusApplyConfiguration { + b.Pending = &value + return b +} + +// WithRunning sets the Running field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Running field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithRunning(value int32) *AppWrapperStatusApplyConfiguration { + b.Running = &value + return b +} + +// WithSucceeded sets the Succeeded field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Succeeded field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithSucceeded(value int32) *AppWrapperStatusApplyConfiguration { + b.Succeeded = &value + return b +} + +// WithFailed sets the Failed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Failed field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithFailed(value int32) *AppWrapperStatusApplyConfiguration { + b.Failed = &value + return b +} + +// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinAvailable field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithMinAvailable(value int32) *AppWrapperStatusApplyConfiguration { + b.MinAvailable = &value + return b +} + +// WithCanRun sets the CanRun field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CanRun field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithCanRun(value bool) *AppWrapperStatusApplyConfiguration { + b.CanRun = &value + return b +} + +// WithIsDispatched sets the IsDispatched field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IsDispatched field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithIsDispatched(value bool) *AppWrapperStatusApplyConfiguration { + b.IsDispatched = &value + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithState(value v1beta1.AppWrapperState) *AppWrapperStatusApplyConfiguration { + b.State = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithMessage(value string) *AppWrapperStatusApplyConfiguration { + b.Message = &value + return b +} + +// WithSystemPriority sets the SystemPriority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SystemPriority field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithSystemPriority(value float64) *AppWrapperStatusApplyConfiguration { + b.SystemPriority = &value + return b +} + +// WithQueueJobState sets the QueueJobState field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QueueJobState field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithQueueJobState(value v1beta1.AppWrapperConditionType) *AppWrapperStatusApplyConfiguration { + b.QueueJobState = &value + return b +} + +// WithControllerFirstTimestamp sets the ControllerFirstTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerFirstTimestamp field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithControllerFirstTimestamp(value v1.MicroTime) *AppWrapperStatusApplyConfiguration { + b.ControllerFirstTimestamp = &value + return b +} + +// WithControllerFirstDispatchTimestamp sets the ControllerFirstDispatchTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerFirstDispatchTimestamp field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithControllerFirstDispatchTimestamp(value v1.MicroTime) *AppWrapperStatusApplyConfiguration { + b.ControllerFirstDispatchTimestamp = &value + return b +} + +// WithFilterIgnore sets the FilterIgnore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FilterIgnore field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithFilterIgnore(value bool) *AppWrapperStatusApplyConfiguration { + b.FilterIgnore = &value + return b +} + +// WithSender sets the Sender field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sender field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithSender(value string) *AppWrapperStatusApplyConfiguration { + b.Sender = &value + return b +} + +// WithLocal sets the Local field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Local field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithLocal(value bool) *AppWrapperStatusApplyConfiguration { + b.Local = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *AppWrapperStatusApplyConfiguration) WithConditions(values ...*AppWrapperConditionApplyConfiguration) *AppWrapperStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithPendingPodConditions adds the given value to the PendingPodConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PendingPodConditions field. +func (b *AppWrapperStatusApplyConfiguration) WithPendingPodConditions(values ...*PendingPodSpecApplyConfiguration) *AppWrapperStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPendingPodConditions") + } + b.PendingPodConditions = append(b.PendingPodConditions, *values[i]) + } + return b +} + +// WithTotalCPU sets the TotalCPU field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TotalCPU field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithTotalCPU(value int32) *AppWrapperStatusApplyConfiguration { + b.TotalCPU = &value + return b +} + +// WithTotalMemory sets the TotalMemory field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TotalMemory field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithTotalMemory(value int32) *AppWrapperStatusApplyConfiguration { + b.TotalMemory = &value + return b +} + +// WithTotalGPU sets the TotalGPU field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TotalGPU field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithTotalGPU(value int32) *AppWrapperStatusApplyConfiguration { + b.TotalGPU = &value + return b +} + +// WithRequeueingTimeInSeconds sets the RequeueingTimeInSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequeueingTimeInSeconds field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithRequeueingTimeInSeconds(value int) *AppWrapperStatusApplyConfiguration { + b.RequeueingTimeInSeconds = &value + return b +} + +// WithNumberOfRequeueings sets the NumberOfRequeueings field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NumberOfRequeueings field is set to the value of the last call. +func (b *AppWrapperStatusApplyConfiguration) WithNumberOfRequeueings(value int) *AppWrapperStatusApplyConfiguration { + b.NumberOfRequeueings = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/custompodresourcetemplate.go b/pkg/client/applyconfiguration/controller/v1beta1/custompodresourcetemplate.go new file mode 100644 index 000000000..4ab6795a2 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/custompodresourcetemplate.go @@ -0,0 +1,61 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// CustomPodResourceTemplateApplyConfiguration represents an declarative configuration of the CustomPodResourceTemplate type for use +// with apply. +type CustomPodResourceTemplateApplyConfiguration struct { + Replicas *int `json:"replicas,omitempty"` + Requests *v1.ResourceList `json:"requests,omitempty"` + Limits *v1.ResourceList `json:"limits,omitempty"` +} + +// CustomPodResourceTemplateApplyConfiguration constructs an declarative configuration of the CustomPodResourceTemplate type for use with +// apply. +func CustomPodResourceTemplate() *CustomPodResourceTemplateApplyConfiguration { + return &CustomPodResourceTemplateApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *CustomPodResourceTemplateApplyConfiguration) WithReplicas(value int) *CustomPodResourceTemplateApplyConfiguration { + b.Replicas = &value + return b +} + +// WithRequests sets the Requests field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Requests field is set to the value of the last call. +func (b *CustomPodResourceTemplateApplyConfiguration) WithRequests(value v1.ResourceList) *CustomPodResourceTemplateApplyConfiguration { + b.Requests = &value + return b +} + +// WithLimits sets the Limits field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Limits field is set to the value of the last call. +func (b *CustomPodResourceTemplateApplyConfiguration) WithLimits(value v1.ResourceList) *CustomPodResourceTemplateApplyConfiguration { + b.Limits = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/dispatchdurationspec.go b/pkg/client/applyconfiguration/controller/v1beta1/dispatchdurationspec.go new file mode 100644 index 000000000..85e3f82bf --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/dispatchdurationspec.go @@ -0,0 +1,57 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// DispatchDurationSpecApplyConfiguration represents an declarative configuration of the DispatchDurationSpec type for use +// with apply. +type DispatchDurationSpecApplyConfiguration struct { + Expected *int `json:"expected,omitempty"` + Limit *int `json:"limit,omitempty"` + Overrun *bool `json:"overrun,omitempty"` +} + +// DispatchDurationSpecApplyConfiguration constructs an declarative configuration of the DispatchDurationSpec type for use with +// apply. +func DispatchDurationSpec() *DispatchDurationSpecApplyConfiguration { + return &DispatchDurationSpecApplyConfiguration{} +} + +// WithExpected sets the Expected field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expected field is set to the value of the last call. +func (b *DispatchDurationSpecApplyConfiguration) WithExpected(value int) *DispatchDurationSpecApplyConfiguration { + b.Expected = &value + return b +} + +// WithLimit sets the Limit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Limit field is set to the value of the last call. +func (b *DispatchDurationSpecApplyConfiguration) WithLimit(value int) *DispatchDurationSpecApplyConfiguration { + b.Limit = &value + return b +} + +// WithOverrun sets the Overrun field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Overrun field is set to the value of the last call. +func (b *DispatchDurationSpecApplyConfiguration) WithOverrun(value bool) *DispatchDurationSpecApplyConfiguration { + b.Overrun = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/pendingpodspec.go b/pkg/client/applyconfiguration/controller/v1beta1/pendingpodspec.go new file mode 100644 index 000000000..3d21ccd17 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/pendingpodspec.go @@ -0,0 +1,54 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PendingPodSpecApplyConfiguration represents an declarative configuration of the PendingPodSpec type for use +// with apply. +type PendingPodSpecApplyConfiguration struct { + PodName *string `json:"podname,omitempty"` + Conditions []v1.PodCondition `json:"conditions,omitempty"` +} + +// PendingPodSpecApplyConfiguration constructs an declarative configuration of the PendingPodSpec type for use with +// apply. +func PendingPodSpec() *PendingPodSpecApplyConfiguration { + return &PendingPodSpecApplyConfiguration{} +} + +// WithPodName sets the PodName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodName field is set to the value of the last call. +func (b *PendingPodSpecApplyConfiguration) WithPodName(value string) *PendingPodSpecApplyConfiguration { + b.PodName = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PendingPodSpecApplyConfiguration) WithConditions(values ...v1.PodCondition) *PendingPodSpecApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/requeuingtemplate.go b/pkg/client/applyconfiguration/controller/v1beta1/requeuingtemplate.go new file mode 100644 index 000000000..d20fa3429 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/requeuingtemplate.go @@ -0,0 +1,84 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// RequeuingTemplateApplyConfiguration represents an declarative configuration of the RequeuingTemplate type for use +// with apply. +type RequeuingTemplateApplyConfiguration struct { + InitialTimeInSeconds *int `json:"initialTimeInSeconds,omitempty"` + TimeInSeconds *int `json:"timeInSeconds,omitempty"` + MaxTimeInSeconds *int `json:"maxTimeInSeconds,omitempty"` + GrowthType *string `json:"growthType,omitempty"` + NumRequeuings *int `json:"numRequeuings,omitempty"` + MaxNumRequeuings *int `json:"maxNumRequeuings,omitempty"` +} + +// RequeuingTemplateApplyConfiguration constructs an declarative configuration of the RequeuingTemplate type for use with +// apply. +func RequeuingTemplate() *RequeuingTemplateApplyConfiguration { + return &RequeuingTemplateApplyConfiguration{} +} + +// WithInitialTimeInSeconds sets the InitialTimeInSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitialTimeInSeconds field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithInitialTimeInSeconds(value int) *RequeuingTemplateApplyConfiguration { + b.InitialTimeInSeconds = &value + return b +} + +// WithTimeInSeconds sets the TimeInSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeInSeconds field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithTimeInSeconds(value int) *RequeuingTemplateApplyConfiguration { + b.TimeInSeconds = &value + return b +} + +// WithMaxTimeInSeconds sets the MaxTimeInSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxTimeInSeconds field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithMaxTimeInSeconds(value int) *RequeuingTemplateApplyConfiguration { + b.MaxTimeInSeconds = &value + return b +} + +// WithGrowthType sets the GrowthType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GrowthType field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithGrowthType(value string) *RequeuingTemplateApplyConfiguration { + b.GrowthType = &value + return b +} + +// WithNumRequeuings sets the NumRequeuings field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NumRequeuings field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithNumRequeuings(value int) *RequeuingTemplateApplyConfiguration { + b.NumRequeuings = &value + return b +} + +// WithMaxNumRequeuings sets the MaxNumRequeuings field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxNumRequeuings field is set to the value of the last call. +func (b *RequeuingTemplateApplyConfiguration) WithMaxNumRequeuings(value int) *RequeuingTemplateApplyConfiguration { + b.MaxNumRequeuings = &value + return b +} diff --git a/pkg/client/applyconfiguration/controller/v1beta1/schedulingspectemplate.go b/pkg/client/applyconfiguration/controller/v1beta1/schedulingspectemplate.go new file mode 100644 index 000000000..7fc3add27 --- /dev/null +++ b/pkg/client/applyconfiguration/controller/v1beta1/schedulingspectemplate.go @@ -0,0 +1,72 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// SchedulingSpecTemplateApplyConfiguration represents an declarative configuration of the SchedulingSpecTemplate type for use +// with apply. +type SchedulingSpecTemplateApplyConfiguration struct { + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + MinAvailable *int `json:"minAvailable,omitempty"` + Requeuing *RequeuingTemplateApplyConfiguration `json:"requeuing,omitempty"` + DispatchDuration *DispatchDurationSpecApplyConfiguration `json:"dispatchDuration,omitempty"` +} + +// SchedulingSpecTemplateApplyConfiguration constructs an declarative configuration of the SchedulingSpecTemplate type for use with +// apply. +func SchedulingSpecTemplate() *SchedulingSpecTemplateApplyConfiguration { + return &SchedulingSpecTemplateApplyConfiguration{} +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *SchedulingSpecTemplateApplyConfiguration) WithNodeSelector(entries map[string]string) *SchedulingSpecTemplateApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinAvailable field is set to the value of the last call. +func (b *SchedulingSpecTemplateApplyConfiguration) WithMinAvailable(value int) *SchedulingSpecTemplateApplyConfiguration { + b.MinAvailable = &value + return b +} + +// WithRequeuing sets the Requeuing field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Requeuing field is set to the value of the last call. +func (b *SchedulingSpecTemplateApplyConfiguration) WithRequeuing(value *RequeuingTemplateApplyConfiguration) *SchedulingSpecTemplateApplyConfiguration { + b.Requeuing = value + return b +} + +// WithDispatchDuration sets the DispatchDuration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DispatchDuration field is set to the value of the last call. +func (b *SchedulingSpecTemplateApplyConfiguration) WithDispatchDuration(value *DispatchDurationSpecApplyConfiguration) *SchedulingSpecTemplateApplyConfiguration { + b.DispatchDuration = value + return b +} diff --git a/pkg/client/applyconfiguration/internal/internal.go b/pkg/client/applyconfiguration/internal/internal.go new file mode 100644 index 000000000..22e0180e2 --- /dev/null +++ b/pkg/client/applyconfiguration/internal/internal.go @@ -0,0 +1,62 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go new file mode 100644 index 000000000..d9bb1eccb --- /dev/null +++ b/pkg/client/applyconfiguration/utils.go @@ -0,0 +1,59 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" + controllerv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/applyconfiguration/controller/v1beta1" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=workload.codeflare.dev, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithKind("AppWrapper"): + return &controllerv1beta1.AppWrapperApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperCondition"): + return &controllerv1beta1.AppWrapperConditionApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperGenericResource"): + return &controllerv1beta1.AppWrapperGenericResourceApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperResourceList"): + return &controllerv1beta1.AppWrapperResourceListApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperService"): + return &controllerv1beta1.AppWrapperServiceApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperSpec"): + return &controllerv1beta1.AppWrapperSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("AppWrapperStatus"): + return &controllerv1beta1.AppWrapperStatusApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("CustomPodResourceTemplate"): + return &controllerv1beta1.CustomPodResourceTemplateApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("DispatchDurationSpec"): + return &controllerv1beta1.DispatchDurationSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("PendingPodSpec"): + return &controllerv1beta1.PendingPodSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("RequeuingTemplate"): + return &controllerv1beta1.RequeuingTemplateApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("SchedulingSpecTemplate"): + return &controllerv1beta1.SchedulingSpecTemplateApplyConfiguration{} + + } + return nil +} From ce5c110401375c8a819b316d7fd01d8896d0e342 Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Tue, 26 Sep 2023 09:59:21 +0200 Subject: [PATCH 3/3] Change quota management API group version to v1alpha1 --- Makefile | 8 +- .../quota.codeflare.dev_quotasubtrees.yaml | 2 +- .../quota.codeflare.dev_quotasubtrees.yaml | 2 +- doc/usage/quota_management/quickstart.md | 6 +- .../quotasubtree/{v1 => v1alpha1}/doc.go | 2 +- .../quotasubtree/{v1 => v1alpha1}/register.go | 4 +- .../quotasubtree/{v1 => v1alpha1}/types.go | 11 ++- .../{v1 => v1alpha1}/zz_generated.deepcopy.go | 2 +- pkg/client/clientset/versioned/clientset.go | 16 +-- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../quotasubtree/{v1 => v1alpha1}/doc.go | 2 +- .../quotasubtree/{v1 => v1alpha1}/fake/doc.go | 0 .../fake/fake_quotasubtree.go | 58 +++++------ .../fake/fake_quotasubtree_client.go | 8 +- .../{v1 => v1alpha1}/generated_expansion.go | 2 +- .../{v1 => v1alpha1}/quotasubtree.go | 56 +++++------ .../{v1 => v1alpha1}/quotasubtree_client.go | 36 +++---- .../informers/externalversions/generic.go | 8 +- .../quotasubtree/interface.go | 12 +-- .../{v1 => v1alpha1}/interface.go | 2 +- .../{v1 => v1alpha1}/quotasubtree.go | 26 ++--- .../listers/quotasubtree/v1/quotasubtree.go | 2 +- .../v1alpha1/expansion_generated.go | 27 +++++ .../quotasubtree/v1alpha1/quotasubtree.go | 99 +++++++++++++++++++ .../quotasubtmgr/event_handlers.go | 2 +- .../quotasubtmgr/quota_subtree_manager.go | 6 +- .../install-quota-subtree.yaml | 8 +- test/e2e-kuttl-borrowing/steps/00-assert.yaml | 2 +- test/e2e-kuttl-borrowing/steps/01-assert.yaml | 8 +- .../steps/04-assert.yaml | 2 +- .../steps/05-assert.yaml | 4 +- .../steps/05-install-single-quota-tree.yaml | 4 +- .../steps/00-assert.yaml | 6 +- .../steps/00-assert.yaml | 6 +- .../steps/03-assert.yaml | 10 +- .../steps/03-install-new-quota-node.yaml | 4 +- test/e2e-kuttl/install-quota-subtree.yaml | 8 +- test/e2e-kuttl/quota-errors/00-assert.yaml | 2 +- test/e2e-kuttl/quota-errors/01-assert.yaml | 6 +- test/e2e-kuttl/quota-forest/00-assert.yaml | 2 +- test/e2e-kuttl/quota-forest/01-assert.yaml | 8 +- 43 files changed, 312 insertions(+), 185 deletions(-) rename pkg/apis/quotaplugins/quotasubtree/{v1 => v1alpha1}/doc.go (97%) rename pkg/apis/quotaplugins/quotasubtree/{v1 => v1alpha1}/register.go (96%) rename pkg/apis/quotaplugins/quotasubtree/{v1 => v1alpha1}/types.go (90%) rename pkg/apis/quotaplugins/quotasubtree/{v1 => v1alpha1}/zz_generated.deepcopy.go (99%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/doc.go (97%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/fake/fake_quotasubtree.go (65%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/fake/fake_quotasubtree_client.go (75%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/generated_expansion.go (97%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/quotasubtree.go (70%) rename pkg/client/clientset/versioned/typed/quotasubtree/{v1 => v1alpha1}/quotasubtree_client.go (67%) rename pkg/client/informers/externalversions/quotasubtree/{v1 => v1alpha1}/interface.go (98%) rename pkg/client/informers/externalversions/quotasubtree/{v1 => v1alpha1}/quotasubtree.go (76%) create mode 100644 pkg/client/listers/quotasubtree/v1alpha1/expansion_generated.go create mode 100644 pkg/client/listers/quotasubtree/v1alpha1/quotasubtree.go diff --git a/Makefile b/Makefile index 649517bfe..432c18a23 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ verify-tag-name: print-global-variables t=${TAG} && [ $${#t} -le 128 ] || { echo "Target name $$t has 128 or more chars"; false; } .PHONY: generate-client ## Generate client packages generate-client: code-generator - rm -rf pkg/client/applyconfiguration pkg/client/clientset/versioned pkg/client/informers/externalversions pkg/client/listers/controller/v1beta1 pkg/client/listers/quotasubtree/v1 + rm -rf pkg/client/applyconfiguration pkg/client/clientset/versioned pkg/client/informers/externalversions pkg/client/listers/controller/v1beta1 pkg/client/listers/quotasubtree/v1alpha1 $(APPLYCONFIGURATION_GEN) \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ @@ -77,7 +77,7 @@ generate-client: code-generator --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(CLIENT_GEN) \ --input="pkg/apis/controller/v1beta1" \ - --input="pkg/apis/quotaplugins/quotasubtree/v1" \ + --input="pkg/apis/quotaplugins/quotasubtree/v1alpha1" \ --input-base="github.com/project-codeflare/multi-cluster-app-dispatcher" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ --clientset-name "versioned" \ @@ -86,14 +86,14 @@ generate-client: code-generator --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(LISTER_GEN) \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ - --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" \ + --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ --output-base="." \ --output-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers" \ --trim-path-prefix "github.com/project-codeflare/multi-cluster-app-dispatcher" $(INFORMER_GEN) \ --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" \ - --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" \ + --input-dirs="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" \ --versioned-clientset-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned" \ --listers-package="github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers" \ --go-header-file="hack/boilerplate/boilerplate.go.txt" \ diff --git a/config/crd/bases/quota.codeflare.dev_quotasubtrees.yaml b/config/crd/bases/quota.codeflare.dev_quotasubtrees.yaml index b66294494..323f9605c 100644 --- a/config/crd/bases/quota.codeflare.dev_quotasubtrees.yaml +++ b/config/crd/bases/quota.codeflare.dev_quotasubtrees.yaml @@ -15,7 +15,7 @@ spec: singular: quotasubtree scope: Namespaced versions: - - name: v1 + - name: v1alpha1 schema: openAPIV3Schema: description: QuotaSubtree is a specification for a quota subtree resource diff --git a/deployment/mcad-controller/crds/quota.codeflare.dev_quotasubtrees.yaml b/deployment/mcad-controller/crds/quota.codeflare.dev_quotasubtrees.yaml index b66294494..323f9605c 100644 --- a/deployment/mcad-controller/crds/quota.codeflare.dev_quotasubtrees.yaml +++ b/deployment/mcad-controller/crds/quota.codeflare.dev_quotasubtrees.yaml @@ -15,7 +15,7 @@ spec: singular: quotasubtree scope: Namespaced versions: - - name: v1 + - name: v1alpha1 schema: openAPIV3Schema: description: QuotaSubtree is a specification for a quota subtree resource diff --git a/doc/usage/quota_management/quickstart.md b/doc/usage/quota_management/quickstart.md index a52a36c8e..e70b95aba 100644 --- a/doc/usage/quota_management/quickstart.md +++ b/doc/usage/quota_management/quickstart.md @@ -11,7 +11,7 @@ One of the key features of quota trees is the hardLimit attribute, which determi from its siblings or not. A sibling is another child node that shares the same parent node. If a quota has hardLimit set to true, then it can only use the resources defined in its specification. If a quota has hardLimit set to false, then it can use any unused resources from its siblings, as long as it does not violate the parent node’s limits. However, if an -object is defined which neccesitates borrowing from a sibling node, then if another kubernetes object is created which +object is defined which necessitates borrowing from a sibling node, then if another kubernetes object is created which uses the borrowees quota (and is within the borrowees limit) then the borrower will be preempted to free these resources. @@ -21,7 +21,7 @@ optimize resource utilization, avoid resource starvation, and ensure quality of ## Example QuotaSubtree ```yaml -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -37,7 +37,7 @@ spec: cpu: 2000m memory: 8000Mi --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/pkg/apis/quotaplugins/quotasubtree/v1/doc.go b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/doc.go similarity index 97% rename from pkg/apis/quotaplugins/quotasubtree/v1/doc.go rename to pkg/apis/quotaplugins/quotasubtree/v1alpha1/doc.go index 6c01b2b54..6cd32350c 100755 --- a/pkg/apis/quotaplugins/quotasubtree/v1/doc.go +++ b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/doc.go @@ -18,4 +18,4 @@ limitations under the License. // +kubebuilder:object:generate=true // +groupName=quota.codeflare.dev -package v1 +package v1alpha1 diff --git a/pkg/apis/quotaplugins/quotasubtree/v1/register.go b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/register.go similarity index 96% rename from pkg/apis/quotaplugins/quotasubtree/v1/register.go rename to pkg/apis/quotaplugins/quotasubtree/v1alpha1/register.go index a83b6e73d..16feafd33 100755 --- a/pkg/apis/quotaplugins/quotasubtree/v1/register.go +++ b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/register.go @@ -1,4 +1,4 @@ -package v1 +package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -16,7 +16,7 @@ const ( GroupName = "quota.codeflare.dev" // GroupVersion is the version of scheduling group - GroupVersion = "v1" + GroupVersion = "v1alpha1" ) // SchemeGroupVersion is the group version used to register these objects. diff --git a/pkg/apis/quotaplugins/quotasubtree/v1/types.go b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/types.go similarity index 90% rename from pkg/apis/quotaplugins/quotasubtree/v1/types.go rename to pkg/apis/quotaplugins/quotasubtree/v1alpha1/types.go index 3b0df3846..b06c85000 100755 --- a/pkg/apis/quotaplugins/quotasubtree/v1/types.go +++ b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/types.go @@ -1,4 +1,5 @@ -package v1 +package v1alpha1 + /* Copyright 2022 The Multi-Cluster App Dispatcher Authors. @@ -54,10 +55,10 @@ type QuotaSubtreeSpec struct { // Child is the spec for a QuotaSubtree resource type Child struct { - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` - Quotas Quota `json:"quotas,omitempty" protobuf:"bytes,4,opt,name=quotas"` - Path string `json:"path,omitempty" protobuf:"bytes,5,opt,name=path"` + Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` + Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` + Quotas Quota `json:"quotas,omitempty" protobuf:"bytes,4,opt,name=quotas"` + Path string `json:"path,omitempty" protobuf:"bytes,5,opt,name=path"` } // Quota is the spec for a QuotaSubtree resource diff --git a/pkg/apis/quotaplugins/quotasubtree/v1/zz_generated.deepcopy.go b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/quotaplugins/quotasubtree/v1/zz_generated.deepcopy.go rename to pkg/apis/quotaplugins/quotasubtree/v1alpha1/zz_generated.deepcopy.go index fcff368b7..7f3f35db1 100644 --- a/pkg/apis/quotaplugins/quotasubtree/v1/zz_generated.deepcopy.go +++ b/pkg/apis/quotaplugins/quotasubtree/v1alpha1/zz_generated.deepcopy.go @@ -19,7 +19,7 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 373f90897..5628f6b42 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -23,7 +23,7 @@ import ( "net/http" workloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/controller/v1beta1" - quotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1" + quotav1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -32,14 +32,14 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface WorkloadV1beta1() workloadv1beta1.WorkloadV1beta1Interface - QuotaV1() quotav1.QuotaV1Interface + QuotaV1alpha1() quotav1alpha1.QuotaV1alpha1Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient workloadV1beta1 *workloadv1beta1.WorkloadV1beta1Client - quotaV1 *quotav1.QuotaV1Client + quotaV1alpha1 *quotav1alpha1.QuotaV1alpha1Client } // WorkloadV1beta1 retrieves the WorkloadV1beta1Client @@ -47,9 +47,9 @@ func (c *Clientset) WorkloadV1beta1() workloadv1beta1.WorkloadV1beta1Interface { return c.workloadV1beta1 } -// QuotaV1 retrieves the QuotaV1Client -func (c *Clientset) QuotaV1() quotav1.QuotaV1Interface { - return c.quotaV1 +// QuotaV1alpha1 retrieves the QuotaV1alpha1Client +func (c *Clientset) QuotaV1alpha1() quotav1alpha1.QuotaV1alpha1Interface { + return c.quotaV1alpha1 } // Discovery retrieves the DiscoveryClient @@ -100,7 +100,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.quotaV1, err = quotav1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.quotaV1alpha1, err = quotav1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.workloadV1beta1 = workloadv1beta1.New(c) - cs.quotaV1 = quotav1.New(c) + cs.quotaV1alpha1 = quotav1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index c0bc5b594..77345d162 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -22,8 +22,8 @@ import ( clientset "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned" workloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/controller/v1beta1" fakeworkloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/controller/v1beta1/fake" - quotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1" - fakequotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake" + quotav1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1" + fakequotav1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -86,7 +86,7 @@ func (c *Clientset) WorkloadV1beta1() workloadv1beta1.WorkloadV1beta1Interface { return &fakeworkloadv1beta1.FakeWorkloadV1beta1{Fake: &c.Fake} } -// QuotaV1 retrieves the QuotaV1Client -func (c *Clientset) QuotaV1() quotav1.QuotaV1Interface { - return &fakequotav1.FakeQuotaV1{Fake: &c.Fake} +// QuotaV1alpha1 retrieves the QuotaV1alpha1Client +func (c *Clientset) QuotaV1alpha1() quotav1alpha1.QuotaV1alpha1Interface { + return &fakequotav1alpha1.FakeQuotaV1alpha1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 6ffb0c808..c86037deb 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -20,7 +20,7 @@ package fake import ( workloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" - quotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + quotav1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +33,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ workloadv1beta1.AddToScheme, - quotav1.AddToScheme, + quotav1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 6cdecec3a..fb580f0bb 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -20,7 +20,7 @@ package scheme import ( workloadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" - quotav1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + quotav1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +33,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ workloadv1beta1.AddToScheme, - quotav1.AddToScheme, + quotav1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/doc.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/doc.go similarity index 97% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/doc.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/doc.go index d75026c76..d444c5b13 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/doc.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1 +package v1alpha1 diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/doc.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree.go similarity index 65% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree.go index 5ff92dca4..466cee344 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree.go @@ -21,8 +21,8 @@ package fake import ( "context" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -31,29 +31,29 @@ import ( // FakeQuotaSubtrees implements QuotaSubtreeInterface type FakeQuotaSubtrees struct { - Fake *FakeQuotaV1 + Fake *FakeQuotaV1alpha1 ns string } -var quotasubtreesResource = v1.SchemeGroupVersion.WithResource("quotasubtrees") +var quotasubtreesResource = v1alpha1.SchemeGroupVersion.WithResource("quotasubtrees") -var quotasubtreesKind = v1.SchemeGroupVersion.WithKind("QuotaSubtree") +var quotasubtreesKind = v1alpha1.SchemeGroupVersion.WithKind("QuotaSubtree") // Get takes name of the quotaSubtree, and returns the corresponding quotaSubtree object, and an error if there is any. -func (c *FakeQuotaSubtrees) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(quotasubtreesResource, c.ns, name), &v1.QuotaSubtree{}) + Invokes(testing.NewGetAction(quotasubtreesResource, c.ns, name), &v1alpha1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*v1.QuotaSubtree), err + return obj.(*v1alpha1.QuotaSubtree), err } // List takes label and field selectors, and returns the list of QuotaSubtrees that match those selectors. -func (c *FakeQuotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) (result *v1.QuotaSubtreeList, err error) { +func (c *FakeQuotaSubtrees) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.QuotaSubtreeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(quotasubtreesResource, quotasubtreesKind, c.ns, opts), &v1.QuotaSubtreeList{}) + Invokes(testing.NewListAction(quotasubtreesResource, quotasubtreesKind, c.ns, opts), &v1alpha1.QuotaSubtreeList{}) if obj == nil { return nil, err @@ -63,8 +63,8 @@ func (c *FakeQuotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) ( if label == nil { label = labels.Everything() } - list := &v1.QuotaSubtreeList{ListMeta: obj.(*v1.QuotaSubtreeList).ListMeta} - for _, item := range obj.(*v1.QuotaSubtreeList).Items { + list := &v1alpha1.QuotaSubtreeList{ListMeta: obj.(*v1alpha1.QuotaSubtreeList).ListMeta} + for _, item := range obj.(*v1alpha1.QuotaSubtreeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -73,69 +73,69 @@ func (c *FakeQuotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) ( } // Watch returns a watch.Interface that watches the requested quotaSubtrees. -func (c *FakeQuotaSubtrees) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *FakeQuotaSubtrees) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(quotasubtreesResource, c.ns, opts)) } // Create takes the representation of a quotaSubtree and creates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *FakeQuotaSubtrees) Create(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.CreateOptions) (result *v1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Create(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.CreateOptions) (result *v1alpha1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1.QuotaSubtree{}) + Invokes(testing.NewCreateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1alpha1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*v1.QuotaSubtree), err + return obj.(*v1alpha1.QuotaSubtree), err } // Update takes the representation of a quotaSubtree and updates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *FakeQuotaSubtrees) Update(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (result *v1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Update(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (result *v1alpha1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1.QuotaSubtree{}) + Invokes(testing.NewUpdateAction(quotasubtreesResource, c.ns, quotaSubtree), &v1alpha1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*v1.QuotaSubtree), err + return obj.(*v1alpha1.QuotaSubtree), 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 *FakeQuotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (*v1.QuotaSubtree, error) { +func (c *FakeQuotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (*v1alpha1.QuotaSubtree, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(quotasubtreesResource, "status", c.ns, quotaSubtree), &v1.QuotaSubtree{}) + Invokes(testing.NewUpdateSubresourceAction(quotasubtreesResource, "status", c.ns, quotaSubtree), &v1alpha1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*v1.QuotaSubtree), err + return obj.(*v1alpha1.QuotaSubtree), err } // Delete takes name of the quotaSubtree and deletes it. Returns an error if one occurs. -func (c *FakeQuotaSubtrees) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *FakeQuotaSubtrees) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(quotasubtreesResource, c.ns, name, opts), &v1.QuotaSubtree{}) + Invokes(testing.NewDeleteActionWithOptions(quotasubtreesResource, c.ns, name, opts), &v1alpha1.QuotaSubtree{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeQuotaSubtrees) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *FakeQuotaSubtrees) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(quotasubtreesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1.QuotaSubtreeList{}) + _, err := c.Fake.Invokes(action, &v1alpha1.QuotaSubtreeList{}) return err } // Patch applies the patch and returns the patched quotaSubtree. -func (c *FakeQuotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.QuotaSubtree, err error) { +func (c *FakeQuotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.QuotaSubtree, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(quotasubtreesResource, c.ns, name, pt, data, subresources...), &v1.QuotaSubtree{}) + Invokes(testing.NewPatchSubresourceAction(quotasubtreesResource, c.ns, name, pt, data, subresources...), &v1alpha1.QuotaSubtree{}) if obj == nil { return nil, err } - return obj.(*v1.QuotaSubtree), err + return obj.(*v1alpha1.QuotaSubtree), err } diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree_client.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree_client.go similarity index 75% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree_client.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree_client.go index a4a68ac32..c6e0fd333 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/fake/fake_quotasubtree_client.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/fake/fake_quotasubtree_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeQuotaV1 struct { +type FakeQuotaV1alpha1 struct { *testing.Fake } -func (c *FakeQuotaV1) QuotaSubtrees(namespace string) v1.QuotaSubtreeInterface { +func (c *FakeQuotaV1alpha1) QuotaSubtrees(namespace string) v1alpha1.QuotaSubtreeInterface { return &FakeQuotaSubtrees{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeQuotaV1) RESTClient() rest.Interface { +func (c *FakeQuotaV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/generated_expansion.go similarity index 97% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/generated_expansion.go index 1f4a9cd17..37f228eb4 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/generated_expansion.go @@ -16,6 +16,6 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 type QuotaSubtreeExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree.go similarity index 70% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree.go index b8b5c0eba..3c6dfcc8e 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" "time" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" scheme "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" @@ -38,15 +38,15 @@ type QuotaSubtreesGetter interface { // QuotaSubtreeInterface has methods to work with QuotaSubtree resources. type QuotaSubtreeInterface interface { - Create(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.CreateOptions) (*v1.QuotaSubtree, error) - Update(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (*v1.QuotaSubtree, error) - UpdateStatus(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (*v1.QuotaSubtree, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.QuotaSubtree, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.QuotaSubtreeList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.QuotaSubtree, err error) + Create(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.CreateOptions) (*v1alpha1.QuotaSubtree, error) + Update(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (*v1alpha1.QuotaSubtree, error) + UpdateStatus(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (*v1alpha1.QuotaSubtree, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.QuotaSubtree, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.QuotaSubtreeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.QuotaSubtree, err error) QuotaSubtreeExpansion } @@ -57,7 +57,7 @@ type quotaSubtrees struct { } // newQuotaSubtrees returns a QuotaSubtrees -func newQuotaSubtrees(c *QuotaV1Client, namespace string) *quotaSubtrees { +func newQuotaSubtrees(c *QuotaV1alpha1Client, namespace string) *quotaSubtrees { return "aSubtrees{ client: c.RESTClient(), ns: namespace, @@ -65,8 +65,8 @@ func newQuotaSubtrees(c *QuotaV1Client, namespace string) *quotaSubtrees { } // Get takes name of the quotaSubtree, and returns the corresponding quotaSubtree object, and an error if there is any. -func (c *quotaSubtrees) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.QuotaSubtree, err error) { - result = &v1.QuotaSubtree{} +func (c *quotaSubtrees) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.QuotaSubtree, err error) { + result = &v1alpha1.QuotaSubtree{} err = c.client.Get(). Namespace(c.ns). Resource("quotasubtrees"). @@ -78,12 +78,12 @@ func (c *quotaSubtrees) Get(ctx context.Context, name string, options metav1.Get } // List takes label and field selectors, and returns the list of QuotaSubtrees that match those selectors. -func (c *quotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) (result *v1.QuotaSubtreeList, err error) { +func (c *quotaSubtrees) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.QuotaSubtreeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1.QuotaSubtreeList{} + result = &v1alpha1.QuotaSubtreeList{} err = c.client.Get(). Namespace(c.ns). Resource("quotasubtrees"). @@ -95,7 +95,7 @@ func (c *quotaSubtrees) List(ctx context.Context, opts metav1.ListOptions) (resu } // Watch returns a watch.Interface that watches the requested quotaSubtrees. -func (c *quotaSubtrees) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *quotaSubtrees) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -110,8 +110,8 @@ func (c *quotaSubtrees) Watch(ctx context.Context, opts metav1.ListOptions) (wat } // Create takes the representation of a quotaSubtree and creates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *quotaSubtrees) Create(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.CreateOptions) (result *v1.QuotaSubtree, err error) { - result = &v1.QuotaSubtree{} +func (c *quotaSubtrees) Create(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.CreateOptions) (result *v1alpha1.QuotaSubtree, err error) { + result = &v1alpha1.QuotaSubtree{} err = c.client.Post(). Namespace(c.ns). Resource("quotasubtrees"). @@ -123,8 +123,8 @@ func (c *quotaSubtrees) Create(ctx context.Context, quotaSubtree *v1.QuotaSubtre } // Update takes the representation of a quotaSubtree and updates it. Returns the server's representation of the quotaSubtree, and an error, if there is any. -func (c *quotaSubtrees) Update(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (result *v1.QuotaSubtree, err error) { - result = &v1.QuotaSubtree{} +func (c *quotaSubtrees) Update(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (result *v1alpha1.QuotaSubtree, err error) { + result = &v1alpha1.QuotaSubtree{} err = c.client.Put(). Namespace(c.ns). Resource("quotasubtrees"). @@ -138,8 +138,8 @@ func (c *quotaSubtrees) Update(ctx context.Context, quotaSubtree *v1.QuotaSubtre // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *quotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1.QuotaSubtree, opts metav1.UpdateOptions) (result *v1.QuotaSubtree, err error) { - result = &v1.QuotaSubtree{} +func (c *quotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1alpha1.QuotaSubtree, opts v1.UpdateOptions) (result *v1alpha1.QuotaSubtree, err error) { + result = &v1alpha1.QuotaSubtree{} err = c.client.Put(). Namespace(c.ns). Resource("quotasubtrees"). @@ -153,7 +153,7 @@ func (c *quotaSubtrees) UpdateStatus(ctx context.Context, quotaSubtree *v1.Quota } // Delete takes name of the quotaSubtree and deletes it. Returns an error if one occurs. -func (c *quotaSubtrees) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *quotaSubtrees) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("quotasubtrees"). @@ -164,7 +164,7 @@ func (c *quotaSubtrees) Delete(ctx context.Context, name string, opts metav1.Del } // DeleteCollection deletes a collection of objects. -func (c *quotaSubtrees) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *quotaSubtrees) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration if listOpts.TimeoutSeconds != nil { timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second @@ -180,8 +180,8 @@ func (c *quotaSubtrees) DeleteCollection(ctx context.Context, opts metav1.Delete } // Patch applies the patch and returns the patched quotaSubtree. -func (c *quotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.QuotaSubtree, err error) { - result = &v1.QuotaSubtree{} +func (c *quotaSubtrees) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.QuotaSubtree, err error) { + result = &v1alpha1.QuotaSubtree{} err = c.client.Patch(pt). Namespace(c.ns). Resource("quotasubtrees"). diff --git a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree_client.go similarity index 67% rename from pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go rename to pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree_client.go index 3cf172cfa..adad9891d 100644 --- a/pkg/client/clientset/versioned/typed/quotasubtree/v1/quotasubtree_client.go +++ b/pkg/client/clientset/versioned/typed/quotasubtree/v1alpha1/quotasubtree_client.go @@ -16,34 +16,34 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "net/http" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type QuotaV1Interface interface { +type QuotaV1alpha1Interface interface { RESTClient() rest.Interface QuotaSubtreesGetter } -// QuotaV1Client is used to interact with features provided by the quota.codeflare.dev group. -type QuotaV1Client struct { +// QuotaV1alpha1Client is used to interact with features provided by the quota.codeflare.dev group. +type QuotaV1alpha1Client struct { restClient rest.Interface } -func (c *QuotaV1Client) QuotaSubtrees(namespace string) QuotaSubtreeInterface { +func (c *QuotaV1alpha1Client) QuotaSubtrees(namespace string) QuotaSubtreeInterface { return newQuotaSubtrees(c, namespace) } -// NewForConfig creates a new QuotaV1Client for the given config. +// NewForConfig creates a new QuotaV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*QuotaV1Client, error) { +func NewForConfig(c *rest.Config) (*QuotaV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -55,9 +55,9 @@ func NewForConfig(c *rest.Config) (*QuotaV1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new QuotaV1Client for the given config and http client. +// NewForConfigAndClient creates a new QuotaV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*QuotaV1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*QuotaV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -66,12 +66,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*QuotaV1Client, erro if err != nil { return nil, err } - return &QuotaV1Client{client}, nil + return &QuotaV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new QuotaV1Client for the given config and +// NewForConfigOrDie creates a new QuotaV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *QuotaV1Client { +func NewForConfigOrDie(c *rest.Config) *QuotaV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -79,13 +79,13 @@ func NewForConfigOrDie(c *rest.Config) *QuotaV1Client { return client } -// New creates a new QuotaV1Client for the given RESTClient. -func New(c rest.Interface) *QuotaV1Client { - return &QuotaV1Client{c} +// New creates a new QuotaV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *QuotaV1alpha1Client { + return &QuotaV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -99,7 +99,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *QuotaV1Client) RESTClient() rest.Interface { +func (c *QuotaV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index b9b46f1e9..98f038207 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -22,7 +22,7 @@ import ( "fmt" v1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -53,9 +53,9 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=quota.codeflare.dev, Version=v1 - case v1.SchemeGroupVersion.WithResource("quotasubtrees"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Quota().V1().QuotaSubtrees().Informer()}, nil + // Group=quota.codeflare.dev, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("quotasubtrees"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Quota().V1alpha1().QuotaSubtrees().Informer()}, nil // Group=workload.codeflare.dev, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("appwrappers"): diff --git a/pkg/client/informers/externalversions/quotasubtree/interface.go b/pkg/client/informers/externalversions/quotasubtree/interface.go index f4b410a4d..0287f2943 100644 --- a/pkg/client/informers/externalversions/quotasubtree/interface.go +++ b/pkg/client/informers/externalversions/quotasubtree/interface.go @@ -20,13 +20,13 @@ package quotasubtree import ( internalinterfaces "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/quotasubtree/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/quotasubtree/v1alpha1" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/quotasubtree/v1/interface.go b/pkg/client/informers/externalversions/quotasubtree/v1alpha1/interface.go similarity index 98% rename from pkg/client/informers/externalversions/quotasubtree/v1/interface.go rename to pkg/client/informers/externalversions/quotasubtree/v1alpha1/interface.go index 8a7b6a348..779c88ce6 100644 --- a/pkg/client/informers/externalversions/quotasubtree/v1/interface.go +++ b/pkg/client/informers/externalversions/quotasubtree/v1alpha1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( internalinterfaces "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/informers/externalversions/quotasubtree/v1/quotasubtree.go b/pkg/client/informers/externalversions/quotasubtree/v1alpha1/quotasubtree.go similarity index 76% rename from pkg/client/informers/externalversions/quotasubtree/v1/quotasubtree.go rename to pkg/client/informers/externalversions/quotasubtree/v1alpha1/quotasubtree.go index 9ed08847f..cf934ed78 100644 --- a/pkg/client/informers/externalversions/quotasubtree/v1/quotasubtree.go +++ b/pkg/client/informers/externalversions/quotasubtree/v1alpha1/quotasubtree.go @@ -16,17 +16,17 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v1alpha1 import ( "context" time "time" - quotasubtreev1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + quotasubtreev1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" versioned "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned" internalinterfaces "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/quotasubtree/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/listers/quotasubtree/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" @@ -36,7 +36,7 @@ import ( // QuotaSubtrees. type QuotaSubtreeInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.QuotaSubtreeLister + Lister() v1alpha1.QuotaSubtreeLister } type quotaSubtreeInformer struct { @@ -58,20 +58,20 @@ func NewQuotaSubtreeInformer(client versioned.Interface, namespace string, resyn func NewFilteredQuotaSubtreeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.QuotaV1().QuotaSubtrees(namespace).List(context.TODO(), options) + return client.QuotaV1alpha1().QuotaSubtrees(namespace).List(context.TODO(), options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.QuotaV1().QuotaSubtrees(namespace).Watch(context.TODO(), options) + return client.QuotaV1alpha1().QuotaSubtrees(namespace).Watch(context.TODO(), options) }, }, - "asubtreev1.QuotaSubtree{}, + "asubtreev1alpha1.QuotaSubtree{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *quotaSubtreeInformer) defaultInformer(client versioned.Interface, resyn } func (f *quotaSubtreeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor("asubtreev1.QuotaSubtree{}, f.defaultInformer) + return f.factory.InformerFor("asubtreev1alpha1.QuotaSubtree{}, f.defaultInformer) } -func (f *quotaSubtreeInformer) Lister() v1.QuotaSubtreeLister { - return v1.NewQuotaSubtreeLister(f.Informer().GetIndexer()) +func (f *quotaSubtreeInformer) Lister() v1alpha1.QuotaSubtreeLister { + return v1alpha1.NewQuotaSubtreeLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/listers/quotasubtree/v1/quotasubtree.go b/pkg/client/listers/quotasubtree/v1/quotasubtree.go index 1b3173057..12c26889b 100644 --- a/pkg/client/listers/quotasubtree/v1/quotasubtree.go +++ b/pkg/client/listers/quotasubtree/v1/quotasubtree.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + v1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/quotasubtree/v1alpha1/expansion_generated.go b/pkg/client/listers/quotasubtree/v1alpha1/expansion_generated.go new file mode 100644 index 000000000..0513f1220 --- /dev/null +++ b/pkg/client/listers/quotasubtree/v1alpha1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// QuotaSubtreeListerExpansion allows custom methods to be added to +// QuotaSubtreeLister. +type QuotaSubtreeListerExpansion interface{} + +// QuotaSubtreeNamespaceListerExpansion allows custom methods to be added to +// QuotaSubtreeNamespaceLister. +type QuotaSubtreeNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/quotasubtree/v1alpha1/quotasubtree.go b/pkg/client/listers/quotasubtree/v1alpha1/quotasubtree.go new file mode 100644 index 000000000..ed0245adf --- /dev/null +++ b/pkg/client/listers/quotasubtree/v1alpha1/quotasubtree.go @@ -0,0 +1,99 @@ +/* +Copyright 2019, 2021, 2022, 2023 The Multi-Cluster App Dispatcher Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// QuotaSubtreeLister helps list QuotaSubtrees. +// All objects returned here must be treated as read-only. +type QuotaSubtreeLister interface { + // List lists all QuotaSubtrees in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.QuotaSubtree, err error) + // QuotaSubtrees returns an object that can list and get QuotaSubtrees. + QuotaSubtrees(namespace string) QuotaSubtreeNamespaceLister + QuotaSubtreeListerExpansion +} + +// quotaSubtreeLister implements the QuotaSubtreeLister interface. +type quotaSubtreeLister struct { + indexer cache.Indexer +} + +// NewQuotaSubtreeLister returns a new QuotaSubtreeLister. +func NewQuotaSubtreeLister(indexer cache.Indexer) QuotaSubtreeLister { + return "aSubtreeLister{indexer: indexer} +} + +// List lists all QuotaSubtrees in the indexer. +func (s *quotaSubtreeLister) List(selector labels.Selector) (ret []*v1alpha1.QuotaSubtree, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.QuotaSubtree)) + }) + return ret, err +} + +// QuotaSubtrees returns an object that can list and get QuotaSubtrees. +func (s *quotaSubtreeLister) QuotaSubtrees(namespace string) QuotaSubtreeNamespaceLister { + return quotaSubtreeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// QuotaSubtreeNamespaceLister helps list and get QuotaSubtrees. +// All objects returned here must be treated as read-only. +type QuotaSubtreeNamespaceLister interface { + // List lists all QuotaSubtrees in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.QuotaSubtree, err error) + // Get retrieves the QuotaSubtree from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.QuotaSubtree, error) + QuotaSubtreeNamespaceListerExpansion +} + +// quotaSubtreeNamespaceLister implements the QuotaSubtreeNamespaceLister +// interface. +type quotaSubtreeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all QuotaSubtrees in the indexer for a given namespace. +func (s quotaSubtreeNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.QuotaSubtree, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.QuotaSubtree)) + }) + return ret, err +} + +// Get retrieves the QuotaSubtree from the indexer for a given namespace and name. +func (s quotaSubtreeNamespaceLister) Get(name string) (*v1alpha1.QuotaSubtree, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("quotasubtree"), name) + } + return obj.(*v1alpha1.QuotaSubtree), nil +} diff --git a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/event_handlers.go b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/event_handlers.go index 94f35ff29..1c3f43cae 100644 --- a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/event_handlers.go +++ b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/event_handlers.go @@ -18,7 +18,7 @@ package quotasubtmgr import ( - qstv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + qstv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" "k8s.io/klog/v2" ) diff --git a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/quota_subtree_manager.go b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/quota_subtree_manager.go index bb3dd5da2..0c0173192 100644 --- a/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/quota_subtree_manager.go +++ b/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/quota_subtree_manager.go @@ -26,7 +26,7 @@ import ( "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota/core" "k8s.io/klog/v2" - qstv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1" + qstv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/quotaplugins/quotasubtree/v1alpha1" "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/util" qmlib "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota" qmlibutils "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota/utils" @@ -37,7 +37,7 @@ import ( "k8s.io/client-go/rest" qstinformers "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions" - qstinformer "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/quotasubtree/v1" + qstinformer "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/informers/externalversions/quotasubtree/v1alpha1" ) // New returns a new implementation. @@ -73,7 +73,7 @@ func newQuotaSubtreeManager(config *rest.Config, quotaManagerBackend *qmlib.Mana qstinformers.WithTweakListOptions(func(opt *metav1.ListOptions) { opt.LabelSelector = util.URMTreeLabel })) - qstm.quotaSubtreeInformer = qstInformerFactory.Quota().V1().QuotaSubtrees() + qstm.quotaSubtreeInformer = qstInformerFactory.Quota().V1alpha1().QuotaSubtrees() // Add event handle for resource plans qstm.quotaSubtreeInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ diff --git a/test/e2e-kuttl-borrowing/install-quota-subtree.yaml b/test/e2e-kuttl-borrowing/install-quota-subtree.yaml index 1fc73cd8c..1ae438f94 100644 --- a/test/e2e-kuttl-borrowing/install-quota-subtree.yaml +++ b/test/e2e-kuttl-borrowing/install-quota-subtree.yaml @@ -1,5 +1,5 @@ --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -15,7 +15,7 @@ spec: memory: 1045Mi nvidia.com/gpu: 16 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -31,7 +31,7 @@ spec: memory: 1045Mi nvidia.com/gpu: 16 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children @@ -70,7 +70,7 @@ spec: memory: 0Mi nvidia.com/gpu: 0 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root-children diff --git a/test/e2e-kuttl-borrowing/steps/00-assert.yaml b/test/e2e-kuttl-borrowing/steps/00-assert.yaml index 596b14e54..f4156248e 100644 --- a/test/e2e-kuttl-borrowing/steps/00-assert.yaml +++ b/test/e2e-kuttl-borrowing/steps/00-assert.yaml @@ -22,4 +22,4 @@ status: singular: quotasubtree plural: quotasubtrees storedVersions: - - v1 + - v1alpha1 diff --git a/test/e2e-kuttl-borrowing/steps/01-assert.yaml b/test/e2e-kuttl-borrowing/steps/01-assert.yaml index 8af089b8c..246c754e6 100644 --- a/test/e2e-kuttl-borrowing/steps/01-assert.yaml +++ b/test/e2e-kuttl-borrowing/steps/01-assert.yaml @@ -1,5 +1,5 @@ # Verify subtree creations -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -7,7 +7,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -15,7 +15,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children @@ -23,7 +23,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root-children diff --git a/test/e2e-kuttl-deployment-01/steps/04-assert.yaml b/test/e2e-kuttl-deployment-01/steps/04-assert.yaml index 89ff22ddb..68f97e97f 100644 --- a/test/e2e-kuttl-deployment-01/steps/04-assert.yaml +++ b/test/e2e-kuttl-deployment-01/steps/04-assert.yaml @@ -22,7 +22,7 @@ status: singular: quotasubtree plural: quotasubtrees storedVersions: - - v1 + - v1alpha1 --- apiVersion: apps/v1 kind: Deployment diff --git a/test/e2e-kuttl-deployment-01/steps/05-assert.yaml b/test/e2e-kuttl-deployment-01/steps/05-assert.yaml index e0816a7f3..c375e1cec 100644 --- a/test/e2e-kuttl-deployment-01/steps/05-assert.yaml +++ b/test/e2e-kuttl-deployment-01/steps/05-assert.yaml @@ -1,5 +1,5 @@ --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -10,7 +10,7 @@ spec: children: - name: context-root --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl-deployment-01/steps/05-install-single-quota-tree.yaml b/test/e2e-kuttl-deployment-01/steps/05-install-single-quota-tree.yaml index 6b963f86e..a14406d07 100644 --- a/test/e2e-kuttl-deployment-01/steps/05-install-single-quota-tree.yaml +++ b/test/e2e-kuttl-deployment-01/steps/05-install-single-quota-tree.yaml @@ -1,5 +1,5 @@ --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -14,7 +14,7 @@ spec: cpu: 1950m memory: 1500Mi --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl-deployment-02/steps/00-assert.yaml b/test/e2e-kuttl-deployment-02/steps/00-assert.yaml index b6664f723..1169fe79c 100644 --- a/test/e2e-kuttl-deployment-02/steps/00-assert.yaml +++ b/test/e2e-kuttl-deployment-02/steps/00-assert.yaml @@ -19,7 +19,7 @@ metadata: name: start-up-02 --- # Verify subtree creations -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -27,7 +27,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -35,7 +35,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl-deployment-03/steps/00-assert.yaml b/test/e2e-kuttl-deployment-03/steps/00-assert.yaml index 136b00361..c6701a42a 100644 --- a/test/e2e-kuttl-deployment-03/steps/00-assert.yaml +++ b/test/e2e-kuttl-deployment-03/steps/00-assert.yaml @@ -19,7 +19,7 @@ metadata: name: start-up-03 --- # Verify subtree creations -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -27,7 +27,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -35,7 +35,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl-deployment-03/steps/03-assert.yaml b/test/e2e-kuttl-deployment-03/steps/03-assert.yaml index 47f7e8f6b..575ce493d 100644 --- a/test/e2e-kuttl-deployment-03/steps/03-assert.yaml +++ b/test/e2e-kuttl-deployment-03/steps/03-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: actinides-root @@ -9,7 +9,7 @@ spec: children: - name: actinides-root --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: actinides-children @@ -22,7 +22,7 @@ spec: - name: plutonium - name: lawrencium --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -30,7 +30,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -38,7 +38,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl-deployment-03/steps/03-install-new-quota-node.yaml b/test/e2e-kuttl-deployment-03/steps/03-install-new-quota-node.yaml index eac904314..1f07c9ab4 100644 --- a/test/e2e-kuttl-deployment-03/steps/03-install-new-quota-node.yaml +++ b/test/e2e-kuttl-deployment-03/steps/03-install-new-quota-node.yaml @@ -1,4 +1,4 @@ -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: actinides-root @@ -13,7 +13,7 @@ spec: cpu: 1075m memory: 1045Mi --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: actinides-children diff --git a/test/e2e-kuttl/install-quota-subtree.yaml b/test/e2e-kuttl/install-quota-subtree.yaml index 1fc73cd8c..1ae438f94 100644 --- a/test/e2e-kuttl/install-quota-subtree.yaml +++ b/test/e2e-kuttl/install-quota-subtree.yaml @@ -1,5 +1,5 @@ --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -15,7 +15,7 @@ spec: memory: 1045Mi nvidia.com/gpu: 16 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -31,7 +31,7 @@ spec: memory: 1045Mi nvidia.com/gpu: 16 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children @@ -70,7 +70,7 @@ spec: memory: 0Mi nvidia.com/gpu: 0 --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root-children diff --git a/test/e2e-kuttl/quota-errors/00-assert.yaml b/test/e2e-kuttl/quota-errors/00-assert.yaml index 596b14e54..f4156248e 100644 --- a/test/e2e-kuttl/quota-errors/00-assert.yaml +++ b/test/e2e-kuttl/quota-errors/00-assert.yaml @@ -22,4 +22,4 @@ status: singular: quotasubtree plural: quotasubtrees storedVersions: - - v1 + - v1alpha1 diff --git a/test/e2e-kuttl/quota-errors/01-assert.yaml b/test/e2e-kuttl/quota-errors/01-assert.yaml index 2fea2b95c..99cc292b9 100644 --- a/test/e2e-kuttl/quota-errors/01-assert.yaml +++ b/test/e2e-kuttl/quota-errors/01-assert.yaml @@ -1,5 +1,5 @@ # Verify subtree creations -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -7,7 +7,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -15,7 +15,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children diff --git a/test/e2e-kuttl/quota-forest/00-assert.yaml b/test/e2e-kuttl/quota-forest/00-assert.yaml index 596b14e54..f4156248e 100644 --- a/test/e2e-kuttl/quota-forest/00-assert.yaml +++ b/test/e2e-kuttl/quota-forest/00-assert.yaml @@ -22,4 +22,4 @@ status: singular: quotasubtree plural: quotasubtrees storedVersions: - - v1 + - v1alpha1 diff --git a/test/e2e-kuttl/quota-forest/01-assert.yaml b/test/e2e-kuttl/quota-forest/01-assert.yaml index 8af089b8c..246c754e6 100644 --- a/test/e2e-kuttl/quota-forest/01-assert.yaml +++ b/test/e2e-kuttl/quota-forest/01-assert.yaml @@ -1,5 +1,5 @@ # Verify subtree creations -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root @@ -7,7 +7,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root @@ -15,7 +15,7 @@ metadata: labels: tree: quota_service --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: context-root-children @@ -23,7 +23,7 @@ metadata: labels: tree: quota_context --- -apiVersion: quota.codeflare.dev/v1 +apiVersion: quota.codeflare.dev/v1alpha1 kind: QuotaSubtree metadata: name: service-root-children