From 0d1a39ea6aab1e413bcf6ddb58f891c02e058c87 Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Tue, 26 Sep 2023 09:47:23 +0200 Subject: [PATCH] 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 693144df..649517bf 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 00000000..1f2493da --- /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 00000000..5a6f59c0 --- /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 00000000..a8d6f849 --- /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 00000000..bd130002 --- /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 00000000..afed9fff --- /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 00000000..8e81f80f --- /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 00000000..d594619d --- /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 00000000..4ab6795a --- /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 00000000..85e3f82b --- /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 00000000..3d21ccd1 --- /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 00000000..d20fa342 --- /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 00000000..7fc3add2 --- /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 00000000..22e0180e --- /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 00000000..d9bb1ecc --- /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 +}