From 7ed434417e14def61d84dafa18fdfa99469a39c5 Mon Sep 17 00:00:00 2001 From: saima sultana Date: Mon, 1 Jul 2024 02:09:03 -0700 Subject: [PATCH] Update code-gen (#2949) --- .../doc.go => build/boilerplate.go.txt | 9 +- build/codegen.sh | 2 +- go.mod | 2 +- pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go | 3 +- .../cr/v1alpha1/actionprogress.go | 96 ++++++++ .../cr/v1alpha1/actionset.go | 218 +++++++++++++++++ .../cr/v1alpha1/actionsetspec.go | 43 ++++ .../cr/v1alpha1/actionsetstatus.go | 74 ++++++ .../cr/v1alpha1/actionspec.go | 156 ++++++++++++ .../cr/v1alpha1/actionstatus.go | 94 ++++++++ .../cr/v1alpha1/artifact.go | 53 ++++ .../cr/v1alpha1/blueprint.go | 216 +++++++++++++++++ .../cr/v1alpha1/blueprintaction.go | 118 +++++++++ .../cr/v1alpha1/blueprintphase.go | 77 ++++++ .../cr/v1alpha1/cachesizesettings.go | 47 ++++ .../cr/v1alpha1/configuration.go | 56 +++++ .../cr/v1alpha1/credential.go | 69 ++++++ .../applyconfiguration/cr/v1alpha1/error.go | 38 +++ .../applyconfiguration/cr/v1alpha1/keypair.go | 56 +++++ .../cr/v1alpha1/kopiaserversecret.go | 80 ++++++ .../cr/v1alpha1/kopiaserversecretref.go | 47 ++++ .../cr/v1alpha1/location.go | 78 ++++++ .../cr/v1alpha1/objectreference.go | 83 +++++++ .../applyconfiguration/cr/v1alpha1/phase.go | 75 ++++++ .../cr/v1alpha1/phaseprogress.go | 96 ++++++++ .../applyconfiguration/cr/v1alpha1/profile.go | 227 ++++++++++++++++++ .../cr/v1alpha1/repository.go | 87 +++++++ .../cr/v1alpha1/repositoryserver.go | 218 +++++++++++++++++ .../cr/v1alpha1/repositoryserverspec.go | 56 +++++ .../cr/v1alpha1/repositoryserverstatus.go | 63 +++++ .../applyconfiguration/cr/v1alpha1/server.go | 60 +++++ .../cr/v1alpha1/serverinfo.go | 47 ++++ .../applyconfiguration/cr/v1alpha1/storage.go | 51 ++++ .../cr/v1alpha1/useraccess.go | 51 ++++ .../applyconfiguration/internal/internal.go | 61 +++++ pkg/client/applyconfiguration/utils.go | 94 ++++++++ pkg/client/clientset/versioned/clientset.go | 6 +- .../versioned/fake/clientset_generated.go | 10 +- pkg/client/clientset/versioned/fake/doc.go | 3 +- .../clientset/versioned/fake/register.go | 6 +- pkg/client/clientset/versioned/scheme/doc.go | 3 +- .../clientset/versioned/scheme/register.go | 6 +- .../versioned/typed/cr/v1alpha1/actionset.go | 38 ++- .../versioned/typed/cr/v1alpha1/blueprint.go | 38 ++- .../versioned/typed/cr/v1alpha1/cr_client.go | 6 +- .../versioned/typed/cr/v1alpha1/doc.go | 3 +- .../versioned/typed/cr/v1alpha1/fake/doc.go | 3 +- .../typed/cr/v1alpha1/fake/fake_actionset.go | 36 ++- .../typed/cr/v1alpha1/fake/fake_blueprint.go | 36 ++- .../typed/cr/v1alpha1/fake/fake_cr_client.go | 6 +- .../typed/cr/v1alpha1/fake/fake_profile.go | 36 ++- .../cr/v1alpha1/fake/fake_repositoryserver.go | 59 ++++- .../typed/cr/v1alpha1/generated_expansion.go | 3 +- .../versioned/typed/cr/v1alpha1/profile.go | 38 ++- .../typed/cr/v1alpha1/repositoryserver.go | 69 +++++- .../externalversions/cr/interface.go | 3 +- .../externalversions/cr/v1alpha1/actionset.go | 12 +- .../externalversions/cr/v1alpha1/blueprint.go | 12 +- .../externalversions/cr/v1alpha1/interface.go | 3 +- .../externalversions/cr/v1alpha1/profile.go | 12 +- .../cr/v1alpha1/repositoryserver.go | 12 +- .../informers/externalversions/factory.go | 24 +- .../informers/externalversions/generic.go | 6 +- .../internalinterfaces/factory_interfaces.go | 6 +- pkg/client/listers/cr/v1alpha1/actionset.go | 10 +- pkg/client/listers/cr/v1alpha1/blueprint.go | 10 +- .../cr/v1alpha1/expansion_generated.go | 3 +- pkg/client/listers/cr/v1alpha1/profile.go | 10 +- .../listers/cr/v1alpha1/repositoryserver.go | 10 +- pkg/controllers/repositoryserver/handler.go | 3 +- pkg/handler/handler.go | 5 +- pkg/kopia/cli/internal/args/args.go | 4 +- pkg/kopia/cli/internal/opts/cache_opts.go | 4 +- pkg/kopia/command/storage/secret_utils.go | 3 +- 74 files changed, 3278 insertions(+), 180 deletions(-) rename pkg/client/clientset/versioned/doc.go => build/boilerplate.go.txt (76%) create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionprogress.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionset.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionsetspec.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionsetstatus.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionspec.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/actionstatus.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/artifact.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/blueprint.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/blueprintaction.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/blueprintphase.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/cachesizesettings.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/configuration.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/credential.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/error.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/keypair.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecret.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecretref.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/location.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/objectreference.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/phase.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/phaseprogress.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/profile.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/repository.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/repositoryserver.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverspec.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/server.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/serverinfo.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/storage.go create mode 100644 pkg/client/applyconfiguration/cr/v1alpha1/useraccess.go create mode 100644 pkg/client/applyconfiguration/internal/internal.go create mode 100644 pkg/client/applyconfiguration/utils.go diff --git a/pkg/client/clientset/versioned/doc.go b/build/boilerplate.go.txt similarity index 76% rename from pkg/client/clientset/versioned/doc.go rename to build/boilerplate.go.txt index 41721ca52d..c43a08400f 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/build/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,9 +12,4 @@ 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 +*/ \ No newline at end of file diff --git a/build/codegen.sh b/build/codegen.sh index f3089fea9c..18434a935a 100755 --- a/build/codegen.sh +++ b/build/codegen.sh @@ -29,5 +29,5 @@ chmod +x "${execDir}"/generate-groups.sh github.com/kanisterio/kanister/pkg/client \ github.com/kanisterio/kanister/pkg/apis \ "cr:v1alpha1" \ - --go-header-file "${execDir}"/hack/boilerplate.go.txt \ + --go-header-file "$PWD"/build/boilerplate.go.txt \ -o /go/src/ diff --git a/go.mod b/go.mod index 35eeceb3c5..c211e3faa0 100644 --- a/go.mod +++ b/go.mod @@ -235,5 +235,5 @@ require ( sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 ) diff --git a/pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go index 406efd37d8..a5010944b6 100644 --- a/pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2023 The Kanister Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ 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 deepcopy-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionprogress.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionprogress.go new file mode 100644 index 0000000000..22f49d34c5 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionprogress.go @@ -0,0 +1,96 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ActionProgressApplyConfiguration represents an declarative configuration of the ActionProgress type for use +// with apply. +type ActionProgressApplyConfiguration struct { + RunningPhase *string `json:"runningPhase,omitempty"` + PercentCompleted *string `json:"percentCompleted,omitempty"` + SizeDownloadedB *int64 `json:"sizeDownloadedB,omitempty"` + SizeUploadedB *int64 `json:"sizeUploadedB,omitempty"` + EstimatedDownloadSizeB *int64 `json:"estimatedDownloadSizeB,omitempty"` + EstimatedUploadSizeB *int64 `json:"estimatedUploadSizeB,omitempty"` + LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` +} + +// ActionProgressApplyConfiguration constructs an declarative configuration of the ActionProgress type for use with +// apply. +func ActionProgress() *ActionProgressApplyConfiguration { + return &ActionProgressApplyConfiguration{} +} + +// WithRunningPhase sets the RunningPhase 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 RunningPhase field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithRunningPhase(value string) *ActionProgressApplyConfiguration { + b.RunningPhase = &value + return b +} + +// WithPercentCompleted sets the PercentCompleted 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 PercentCompleted field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithPercentCompleted(value string) *ActionProgressApplyConfiguration { + b.PercentCompleted = &value + return b +} + +// WithSizeDownloadedB sets the SizeDownloadedB 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 SizeDownloadedB field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithSizeDownloadedB(value int64) *ActionProgressApplyConfiguration { + b.SizeDownloadedB = &value + return b +} + +// WithSizeUploadedB sets the SizeUploadedB 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 SizeUploadedB field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithSizeUploadedB(value int64) *ActionProgressApplyConfiguration { + b.SizeUploadedB = &value + return b +} + +// WithEstimatedDownloadSizeB sets the EstimatedDownloadSizeB 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 EstimatedDownloadSizeB field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithEstimatedDownloadSizeB(value int64) *ActionProgressApplyConfiguration { + b.EstimatedDownloadSizeB = &value + return b +} + +// WithEstimatedUploadSizeB sets the EstimatedUploadSizeB 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 EstimatedUploadSizeB field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithEstimatedUploadSizeB(value int64) *ActionProgressApplyConfiguration { + b.EstimatedUploadSizeB = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call. +func (b *ActionProgressApplyConfiguration) WithLastTransitionTime(value v1.Time) *ActionProgressApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionset.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionset.go new file mode 100644 index 0000000000..ec90ed681b --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionset.go @@ -0,0 +1,218 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ActionSetApplyConfiguration represents an declarative configuration of the ActionSet type for use +// with apply. +type ActionSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ActionSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *ActionSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// ActionSet constructs an declarative configuration of the ActionSet type for use with +// apply. +func ActionSet(name, namespace string) *ActionSetApplyConfiguration { + b := &ActionSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ActionSet") + b.WithAPIVersion("cr.kanister.io/v1alpha1") + 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 *ActionSetApplyConfiguration) WithKind(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithAPIVersion(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithName(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithGenerateName(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithNamespace(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithUID(value types.UID) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithResourceVersion(value string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithGeneration(value int64) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithLabels(entries map[string]string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithAnnotations(entries map[string]string) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithFinalizers(values ...string) *ActionSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ActionSetApplyConfiguration) 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 *ActionSetApplyConfiguration) WithSpec(value *ActionSetSpecApplyConfiguration) *ActionSetApplyConfiguration { + 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 *ActionSetApplyConfiguration) WithStatus(value *ActionSetStatusApplyConfiguration) *ActionSetApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionsetspec.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionsetspec.go new file mode 100644 index 0000000000..2cf1bfe4a0 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionsetspec.go @@ -0,0 +1,43 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ActionSetSpecApplyConfiguration represents an declarative configuration of the ActionSetSpec type for use +// with apply. +type ActionSetSpecApplyConfiguration struct { + Actions []ActionSpecApplyConfiguration `json:"actions,omitempty"` +} + +// ActionSetSpecApplyConfiguration constructs an declarative configuration of the ActionSetSpec type for use with +// apply. +func ActionSetSpec() *ActionSetSpecApplyConfiguration { + return &ActionSetSpecApplyConfiguration{} +} + +// WithActions adds the given value to the Actions 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 Actions field. +func (b *ActionSetSpecApplyConfiguration) WithActions(values ...*ActionSpecApplyConfiguration) *ActionSetSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithActions") + } + b.Actions = append(b.Actions, *values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionsetstatus.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionsetstatus.go new file mode 100644 index 0000000000..3a730f2515 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionsetstatus.go @@ -0,0 +1,74 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" +) + +// ActionSetStatusApplyConfiguration represents an declarative configuration of the ActionSetStatus type for use +// with apply. +type ActionSetStatusApplyConfiguration struct { + State *v1alpha1.State `json:"state,omitempty"` + Actions []ActionStatusApplyConfiguration `json:"actions,omitempty"` + Error *ErrorApplyConfiguration `json:"error,omitempty"` + Progress *ActionProgressApplyConfiguration `json:"progress,omitempty"` +} + +// ActionSetStatusApplyConfiguration constructs an declarative configuration of the ActionSetStatus type for use with +// apply. +func ActionSetStatus() *ActionSetStatusApplyConfiguration { + return &ActionSetStatusApplyConfiguration{} +} + +// 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 *ActionSetStatusApplyConfiguration) WithState(value v1alpha1.State) *ActionSetStatusApplyConfiguration { + b.State = &value + return b +} + +// WithActions adds the given value to the Actions 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 Actions field. +func (b *ActionSetStatusApplyConfiguration) WithActions(values ...*ActionStatusApplyConfiguration) *ActionSetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithActions") + } + b.Actions = append(b.Actions, *values[i]) + } + return b +} + +// WithError sets the Error 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 Error field is set to the value of the last call. +func (b *ActionSetStatusApplyConfiguration) WithError(value *ErrorApplyConfiguration) *ActionSetStatusApplyConfiguration { + b.Error = value + return b +} + +// WithProgress sets the Progress 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 Progress field is set to the value of the last call. +func (b *ActionSetStatusApplyConfiguration) WithProgress(value *ActionProgressApplyConfiguration) *ActionSetStatusApplyConfiguration { + b.Progress = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionspec.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionspec.go new file mode 100644 index 0000000000..3efd47dc88 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionspec.go @@ -0,0 +1,156 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" +) + +// ActionSpecApplyConfiguration represents an declarative configuration of the ActionSpec type for use +// with apply. +type ActionSpecApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Object *ObjectReferenceApplyConfiguration `json:"object,omitempty"` + Blueprint *string `json:"blueprint,omitempty"` + Artifacts map[string]ArtifactApplyConfiguration `json:"artifacts,omitempty"` + ConfigMaps map[string]ObjectReferenceApplyConfiguration `json:"configMaps,omitempty"` + Secrets map[string]ObjectReferenceApplyConfiguration `json:"secrets,omitempty"` + Profile *ObjectReferenceApplyConfiguration `json:"profile,omitempty"` + RepositoryServer *ObjectReferenceApplyConfiguration `json:"repositoryServer,omitempty"` + PodOverride *crv1alpha1.JSONMap `json:"podOverride,omitempty"` + Options map[string]string `json:"options,omitempty"` + PreferredVersion *string `json:"preferredVersion,omitempty"` +} + +// ActionSpecApplyConfiguration constructs an declarative configuration of the ActionSpec type for use with +// apply. +func ActionSpec() *ActionSpecApplyConfiguration { + return &ActionSpecApplyConfiguration{} +} + +// 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 *ActionSpecApplyConfiguration) WithName(value string) *ActionSpecApplyConfiguration { + b.Name = &value + return b +} + +// WithObject sets the Object 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 Object field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithObject(value *ObjectReferenceApplyConfiguration) *ActionSpecApplyConfiguration { + b.Object = value + return b +} + +// WithBlueprint sets the Blueprint 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 Blueprint field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithBlueprint(value string) *ActionSpecApplyConfiguration { + b.Blueprint = &value + return b +} + +// WithArtifacts puts the entries into the Artifacts 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 Artifacts field, +// overwriting an existing map entries in Artifacts field with the same key. +func (b *ActionSpecApplyConfiguration) WithArtifacts(entries map[string]ArtifactApplyConfiguration) *ActionSpecApplyConfiguration { + if b.Artifacts == nil && len(entries) > 0 { + b.Artifacts = make(map[string]ArtifactApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Artifacts[k] = v + } + return b +} + +// WithConfigMaps puts the entries into the ConfigMaps 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 ConfigMaps field, +// overwriting an existing map entries in ConfigMaps field with the same key. +func (b *ActionSpecApplyConfiguration) WithConfigMaps(entries map[string]ObjectReferenceApplyConfiguration) *ActionSpecApplyConfiguration { + if b.ConfigMaps == nil && len(entries) > 0 { + b.ConfigMaps = make(map[string]ObjectReferenceApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.ConfigMaps[k] = v + } + return b +} + +// WithSecrets puts the entries into the Secrets 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 Secrets field, +// overwriting an existing map entries in Secrets field with the same key. +func (b *ActionSpecApplyConfiguration) WithSecrets(entries map[string]ObjectReferenceApplyConfiguration) *ActionSpecApplyConfiguration { + if b.Secrets == nil && len(entries) > 0 { + b.Secrets = make(map[string]ObjectReferenceApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Secrets[k] = v + } + return b +} + +// WithProfile sets the Profile 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 Profile field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithProfile(value *ObjectReferenceApplyConfiguration) *ActionSpecApplyConfiguration { + b.Profile = value + return b +} + +// WithRepositoryServer sets the RepositoryServer 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 RepositoryServer field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithRepositoryServer(value *ObjectReferenceApplyConfiguration) *ActionSpecApplyConfiguration { + b.RepositoryServer = value + return b +} + +// WithPodOverride sets the PodOverride 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 PodOverride field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithPodOverride(value crv1alpha1.JSONMap) *ActionSpecApplyConfiguration { + b.PodOverride = &value + return b +} + +// WithOptions puts the entries into the Options 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 Options field, +// overwriting an existing map entries in Options field with the same key. +func (b *ActionSpecApplyConfiguration) WithOptions(entries map[string]string) *ActionSpecApplyConfiguration { + if b.Options == nil && len(entries) > 0 { + b.Options = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Options[k] = v + } + return b +} + +// WithPreferredVersion sets the PreferredVersion 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 PreferredVersion field is set to the value of the last call. +func (b *ActionSpecApplyConfiguration) WithPreferredVersion(value string) *ActionSpecApplyConfiguration { + b.PreferredVersion = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/actionstatus.go b/pkg/client/applyconfiguration/cr/v1alpha1/actionstatus.go new file mode 100644 index 0000000000..fd8d8d68b2 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/actionstatus.go @@ -0,0 +1,94 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ActionStatusApplyConfiguration represents an declarative configuration of the ActionStatus type for use +// with apply. +type ActionStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Object *ObjectReferenceApplyConfiguration `json:"object,omitempty"` + Blueprint *string `json:"blueprint,omitempty"` + Phases []PhaseApplyConfiguration `json:"phases,omitempty"` + Artifacts map[string]ArtifactApplyConfiguration `json:"artifacts,omitempty"` + DeferPhase *PhaseApplyConfiguration `json:"deferPhase,omitempty"` +} + +// ActionStatusApplyConfiguration constructs an declarative configuration of the ActionStatus type for use with +// apply. +func ActionStatus() *ActionStatusApplyConfiguration { + return &ActionStatusApplyConfiguration{} +} + +// 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 *ActionStatusApplyConfiguration) WithName(value string) *ActionStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithObject sets the Object 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 Object field is set to the value of the last call. +func (b *ActionStatusApplyConfiguration) WithObject(value *ObjectReferenceApplyConfiguration) *ActionStatusApplyConfiguration { + b.Object = value + return b +} + +// WithBlueprint sets the Blueprint 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 Blueprint field is set to the value of the last call. +func (b *ActionStatusApplyConfiguration) WithBlueprint(value string) *ActionStatusApplyConfiguration { + b.Blueprint = &value + return b +} + +// WithPhases adds the given value to the Phases 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 Phases field. +func (b *ActionStatusApplyConfiguration) WithPhases(values ...*PhaseApplyConfiguration) *ActionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPhases") + } + b.Phases = append(b.Phases, *values[i]) + } + return b +} + +// WithArtifacts puts the entries into the Artifacts 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 Artifacts field, +// overwriting an existing map entries in Artifacts field with the same key. +func (b *ActionStatusApplyConfiguration) WithArtifacts(entries map[string]ArtifactApplyConfiguration) *ActionStatusApplyConfiguration { + if b.Artifacts == nil && len(entries) > 0 { + b.Artifacts = make(map[string]ArtifactApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Artifacts[k] = v + } + return b +} + +// WithDeferPhase sets the DeferPhase 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 DeferPhase field is set to the value of the last call. +func (b *ActionStatusApplyConfiguration) WithDeferPhase(value *PhaseApplyConfiguration) *ActionStatusApplyConfiguration { + b.DeferPhase = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/artifact.go b/pkg/client/applyconfiguration/cr/v1alpha1/artifact.go new file mode 100644 index 0000000000..533c86f404 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/artifact.go @@ -0,0 +1,53 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ArtifactApplyConfiguration represents an declarative configuration of the Artifact type for use +// with apply. +type ArtifactApplyConfiguration struct { + KeyValue map[string]string `json:"keyValue,omitempty"` + KopiaSnapshot *string `json:"kopiaSnapshot,omitempty"` +} + +// ArtifactApplyConfiguration constructs an declarative configuration of the Artifact type for use with +// apply. +func Artifact() *ArtifactApplyConfiguration { + return &ArtifactApplyConfiguration{} +} + +// WithKeyValue puts the entries into the KeyValue 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 KeyValue field, +// overwriting an existing map entries in KeyValue field with the same key. +func (b *ArtifactApplyConfiguration) WithKeyValue(entries map[string]string) *ArtifactApplyConfiguration { + if b.KeyValue == nil && len(entries) > 0 { + b.KeyValue = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.KeyValue[k] = v + } + return b +} + +// WithKopiaSnapshot sets the KopiaSnapshot 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 KopiaSnapshot field is set to the value of the last call. +func (b *ArtifactApplyConfiguration) WithKopiaSnapshot(value string) *ArtifactApplyConfiguration { + b.KopiaSnapshot = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/blueprint.go b/pkg/client/applyconfiguration/cr/v1alpha1/blueprint.go new file mode 100644 index 0000000000..31503c222a --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/blueprint.go @@ -0,0 +1,216 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// BlueprintApplyConfiguration represents an declarative configuration of the Blueprint type for use +// with apply. +type BlueprintApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Actions map[string]*v1alpha1.BlueprintAction `json:"actions,omitempty"` +} + +// Blueprint constructs an declarative configuration of the Blueprint type for use with +// apply. +func Blueprint(name, namespace string) *BlueprintApplyConfiguration { + b := &BlueprintApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Blueprint") + b.WithAPIVersion("cr.kanister.io/v1alpha1") + 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 *BlueprintApplyConfiguration) WithKind(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithAPIVersion(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithName(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithGenerateName(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithNamespace(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithUID(value types.UID) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithResourceVersion(value string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithGeneration(value int64) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithLabels(entries map[string]string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithAnnotations(entries map[string]string) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BlueprintApplyConfiguration { + 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 *BlueprintApplyConfiguration) WithFinalizers(values ...string) *BlueprintApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BlueprintApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithActions puts the entries into the Actions 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 Actions field, +// overwriting an existing map entries in Actions field with the same key. +func (b *BlueprintApplyConfiguration) WithActions(entries map[string]*v1alpha1.BlueprintAction) *BlueprintApplyConfiguration { + if b.Actions == nil && len(entries) > 0 { + b.Actions = make(map[string]*v1alpha1.BlueprintAction, len(entries)) + } + for k, v := range entries { + b.Actions[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/blueprintaction.go b/pkg/client/applyconfiguration/cr/v1alpha1/blueprintaction.go new file mode 100644 index 0000000000..c93ed3c748 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/blueprintaction.go @@ -0,0 +1,118 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// BlueprintActionApplyConfiguration represents an declarative configuration of the BlueprintAction type for use +// with apply. +type BlueprintActionApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Kind *string `json:"kind,omitempty"` + ConfigMapNames []string `json:"configMapNames,omitempty"` + SecretNames []string `json:"secretNames,omitempty"` + InputArtifactNames []string `json:"inputArtifactNames,omitempty"` + OutputArtifacts map[string]ArtifactApplyConfiguration `json:"outputArtifacts,omitempty"` + Phases []BlueprintPhaseApplyConfiguration `json:"phases,omitempty"` + DeferPhase *BlueprintPhaseApplyConfiguration `json:"deferPhase,omitempty"` +} + +// BlueprintActionApplyConfiguration constructs an declarative configuration of the BlueprintAction type for use with +// apply. +func BlueprintAction() *BlueprintActionApplyConfiguration { + return &BlueprintActionApplyConfiguration{} +} + +// 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 *BlueprintActionApplyConfiguration) WithName(value string) *BlueprintActionApplyConfiguration { + b.Name = &value + 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 *BlueprintActionApplyConfiguration) WithKind(value string) *BlueprintActionApplyConfiguration { + b.Kind = &value + return b +} + +// WithConfigMapNames adds the given value to the ConfigMapNames 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 ConfigMapNames field. +func (b *BlueprintActionApplyConfiguration) WithConfigMapNames(values ...string) *BlueprintActionApplyConfiguration { + for i := range values { + b.ConfigMapNames = append(b.ConfigMapNames, values[i]) + } + return b +} + +// WithSecretNames adds the given value to the SecretNames 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 SecretNames field. +func (b *BlueprintActionApplyConfiguration) WithSecretNames(values ...string) *BlueprintActionApplyConfiguration { + for i := range values { + b.SecretNames = append(b.SecretNames, values[i]) + } + return b +} + +// WithInputArtifactNames adds the given value to the InputArtifactNames 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 InputArtifactNames field. +func (b *BlueprintActionApplyConfiguration) WithInputArtifactNames(values ...string) *BlueprintActionApplyConfiguration { + for i := range values { + b.InputArtifactNames = append(b.InputArtifactNames, values[i]) + } + return b +} + +// WithOutputArtifacts puts the entries into the OutputArtifacts 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 OutputArtifacts field, +// overwriting an existing map entries in OutputArtifacts field with the same key. +func (b *BlueprintActionApplyConfiguration) WithOutputArtifacts(entries map[string]ArtifactApplyConfiguration) *BlueprintActionApplyConfiguration { + if b.OutputArtifacts == nil && len(entries) > 0 { + b.OutputArtifacts = make(map[string]ArtifactApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.OutputArtifacts[k] = v + } + return b +} + +// WithPhases adds the given value to the Phases 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 Phases field. +func (b *BlueprintActionApplyConfiguration) WithPhases(values ...*BlueprintPhaseApplyConfiguration) *BlueprintActionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPhases") + } + b.Phases = append(b.Phases, *values[i]) + } + return b +} + +// WithDeferPhase sets the DeferPhase 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 DeferPhase field is set to the value of the last call. +func (b *BlueprintActionApplyConfiguration) WithDeferPhase(value *BlueprintPhaseApplyConfiguration) *BlueprintActionApplyConfiguration { + b.DeferPhase = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/blueprintphase.go b/pkg/client/applyconfiguration/cr/v1alpha1/blueprintphase.go new file mode 100644 index 0000000000..42dbd9b22d --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/blueprintphase.go @@ -0,0 +1,77 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// BlueprintPhaseApplyConfiguration represents an declarative configuration of the BlueprintPhase type for use +// with apply. +type BlueprintPhaseApplyConfiguration struct { + Func *string `json:"func,omitempty"` + Name *string `json:"name,omitempty"` + ObjectRefs map[string]ObjectReferenceApplyConfiguration `json:"objects,omitempty"` + Args map[string]interface{} `json:"args,omitempty"` +} + +// BlueprintPhaseApplyConfiguration constructs an declarative configuration of the BlueprintPhase type for use with +// apply. +func BlueprintPhase() *BlueprintPhaseApplyConfiguration { + return &BlueprintPhaseApplyConfiguration{} +} + +// WithFunc sets the Func 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 Func field is set to the value of the last call. +func (b *BlueprintPhaseApplyConfiguration) WithFunc(value string) *BlueprintPhaseApplyConfiguration { + b.Func = &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 *BlueprintPhaseApplyConfiguration) WithName(value string) *BlueprintPhaseApplyConfiguration { + b.Name = &value + return b +} + +// WithObjectRefs puts the entries into the ObjectRefs 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 ObjectRefs field, +// overwriting an existing map entries in ObjectRefs field with the same key. +func (b *BlueprintPhaseApplyConfiguration) WithObjectRefs(entries map[string]ObjectReferenceApplyConfiguration) *BlueprintPhaseApplyConfiguration { + if b.ObjectRefs == nil && len(entries) > 0 { + b.ObjectRefs = make(map[string]ObjectReferenceApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.ObjectRefs[k] = v + } + return b +} + +// WithArgs puts the entries into the Args 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 Args field, +// overwriting an existing map entries in Args field with the same key. +func (b *BlueprintPhaseApplyConfiguration) WithArgs(entries map[string]interface{}) *BlueprintPhaseApplyConfiguration { + if b.Args == nil && len(entries) > 0 { + b.Args = make(map[string]interface{}, len(entries)) + } + for k, v := range entries { + b.Args[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/cachesizesettings.go b/pkg/client/applyconfiguration/cr/v1alpha1/cachesizesettings.go new file mode 100644 index 0000000000..77eef616f2 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/cachesizesettings.go @@ -0,0 +1,47 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// CacheSizeSettingsApplyConfiguration represents an declarative configuration of the CacheSizeSettings type for use +// with apply. +type CacheSizeSettingsApplyConfiguration struct { + Metadata *int `json:"metadata,omitempty"` + Content *int `json:"content,omitempty"` +} + +// CacheSizeSettingsApplyConfiguration constructs an declarative configuration of the CacheSizeSettings type for use with +// apply. +func CacheSizeSettings() *CacheSizeSettingsApplyConfiguration { + return &CacheSizeSettingsApplyConfiguration{} +} + +// WithMetadata sets the Metadata 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 Metadata field is set to the value of the last call. +func (b *CacheSizeSettingsApplyConfiguration) WithMetadata(value int) *CacheSizeSettingsApplyConfiguration { + b.Metadata = &value + return b +} + +// WithContent sets the Content 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 Content field is set to the value of the last call. +func (b *CacheSizeSettingsApplyConfiguration) WithContent(value int) *CacheSizeSettingsApplyConfiguration { + b.Content = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/configuration.go b/pkg/client/applyconfiguration/cr/v1alpha1/configuration.go new file mode 100644 index 0000000000..9e29803916 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/configuration.go @@ -0,0 +1,56 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ConfigurationApplyConfiguration represents an declarative configuration of the Configuration type for use +// with apply. +type ConfigurationApplyConfiguration struct { + CacheDirectory *string `json:"cacheDirectory,omitempty"` + LogDirectory *string `json:"logDirectory,omitempty"` + ConfigFilePath *string `json:"configFilePath,omitempty"` +} + +// ConfigurationApplyConfiguration constructs an declarative configuration of the Configuration type for use with +// apply. +func Configuration() *ConfigurationApplyConfiguration { + return &ConfigurationApplyConfiguration{} +} + +// WithCacheDirectory sets the CacheDirectory 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 CacheDirectory field is set to the value of the last call. +func (b *ConfigurationApplyConfiguration) WithCacheDirectory(value string) *ConfigurationApplyConfiguration { + b.CacheDirectory = &value + return b +} + +// WithLogDirectory sets the LogDirectory 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 LogDirectory field is set to the value of the last call. +func (b *ConfigurationApplyConfiguration) WithLogDirectory(value string) *ConfigurationApplyConfiguration { + b.LogDirectory = &value + return b +} + +// WithConfigFilePath sets the ConfigFilePath 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 ConfigFilePath field is set to the value of the last call. +func (b *ConfigurationApplyConfiguration) WithConfigFilePath(value string) *ConfigurationApplyConfiguration { + b.ConfigFilePath = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/credential.go b/pkg/client/applyconfiguration/cr/v1alpha1/credential.go new file mode 100644 index 0000000000..f94e586e56 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/credential.go @@ -0,0 +1,69 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" +) + +// CredentialApplyConfiguration represents an declarative configuration of the Credential type for use +// with apply. +type CredentialApplyConfiguration struct { + Type *v1alpha1.CredentialType `json:"type,omitempty"` + KeyPair *KeyPairApplyConfiguration `json:"keyPair,omitempty"` + Secret *ObjectReferenceApplyConfiguration `json:"secret,omitempty"` + KopiaServerSecret *KopiaServerSecretApplyConfiguration `json:"kopiaServerSecret,omitempty"` +} + +// CredentialApplyConfiguration constructs an declarative configuration of the Credential type for use with +// apply. +func Credential() *CredentialApplyConfiguration { + return &CredentialApplyConfiguration{} +} + +// 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 *CredentialApplyConfiguration) WithType(value v1alpha1.CredentialType) *CredentialApplyConfiguration { + b.Type = &value + return b +} + +// WithKeyPair sets the KeyPair 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 KeyPair field is set to the value of the last call. +func (b *CredentialApplyConfiguration) WithKeyPair(value *KeyPairApplyConfiguration) *CredentialApplyConfiguration { + b.KeyPair = value + return b +} + +// WithSecret sets the Secret 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 Secret field is set to the value of the last call. +func (b *CredentialApplyConfiguration) WithSecret(value *ObjectReferenceApplyConfiguration) *CredentialApplyConfiguration { + b.Secret = value + return b +} + +// WithKopiaServerSecret sets the KopiaServerSecret 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 KopiaServerSecret field is set to the value of the last call. +func (b *CredentialApplyConfiguration) WithKopiaServerSecret(value *KopiaServerSecretApplyConfiguration) *CredentialApplyConfiguration { + b.KopiaServerSecret = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/error.go b/pkg/client/applyconfiguration/cr/v1alpha1/error.go new file mode 100644 index 0000000000..d336531294 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/error.go @@ -0,0 +1,38 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ErrorApplyConfiguration represents an declarative configuration of the Error type for use +// with apply. +type ErrorApplyConfiguration struct { + Message *string `json:"message,omitempty"` +} + +// ErrorApplyConfiguration constructs an declarative configuration of the Error type for use with +// apply. +func Error() *ErrorApplyConfiguration { + return &ErrorApplyConfiguration{} +} + +// 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 *ErrorApplyConfiguration) WithMessage(value string) *ErrorApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/keypair.go b/pkg/client/applyconfiguration/cr/v1alpha1/keypair.go new file mode 100644 index 0000000000..53c532efa2 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/keypair.go @@ -0,0 +1,56 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// KeyPairApplyConfiguration represents an declarative configuration of the KeyPair type for use +// with apply. +type KeyPairApplyConfiguration struct { + IDField *string `json:"idField,omitempty"` + SecretField *string `json:"secretField,omitempty"` + Secret *ObjectReferenceApplyConfiguration `json:"secret,omitempty"` +} + +// KeyPairApplyConfiguration constructs an declarative configuration of the KeyPair type for use with +// apply. +func KeyPair() *KeyPairApplyConfiguration { + return &KeyPairApplyConfiguration{} +} + +// WithIDField sets the IDField 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 IDField field is set to the value of the last call. +func (b *KeyPairApplyConfiguration) WithIDField(value string) *KeyPairApplyConfiguration { + b.IDField = &value + return b +} + +// WithSecretField sets the SecretField 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 SecretField field is set to the value of the last call. +func (b *KeyPairApplyConfiguration) WithSecretField(value string) *KeyPairApplyConfiguration { + b.SecretField = &value + return b +} + +// WithSecret sets the Secret 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 Secret field is set to the value of the last call. +func (b *KeyPairApplyConfiguration) WithSecret(value *ObjectReferenceApplyConfiguration) *KeyPairApplyConfiguration { + b.Secret = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecret.go b/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecret.go new file mode 100644 index 0000000000..83561ea0da --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecret.go @@ -0,0 +1,80 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// KopiaServerSecretApplyConfiguration represents an declarative configuration of the KopiaServerSecret type for use +// with apply. +type KopiaServerSecretApplyConfiguration struct { + Username *string `json:"username,omitempty"` + Hostname *string `json:"hostname,omitempty"` + UserPassphrase *KopiaServerSecretRefApplyConfiguration `json:"userPassphrase,omitempty"` + TLSCert *KopiaServerSecretRefApplyConfiguration `json:"tlsCert,omitempty"` + ConnectOptions map[string]int `json:"connectOptions,omitempty"` +} + +// KopiaServerSecretApplyConfiguration constructs an declarative configuration of the KopiaServerSecret type for use with +// apply. +func KopiaServerSecret() *KopiaServerSecretApplyConfiguration { + return &KopiaServerSecretApplyConfiguration{} +} + +// WithUsername sets the Username 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 Username field is set to the value of the last call. +func (b *KopiaServerSecretApplyConfiguration) WithUsername(value string) *KopiaServerSecretApplyConfiguration { + b.Username = &value + return b +} + +// WithHostname sets the Hostname 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 Hostname field is set to the value of the last call. +func (b *KopiaServerSecretApplyConfiguration) WithHostname(value string) *KopiaServerSecretApplyConfiguration { + b.Hostname = &value + return b +} + +// WithUserPassphrase sets the UserPassphrase 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 UserPassphrase field is set to the value of the last call. +func (b *KopiaServerSecretApplyConfiguration) WithUserPassphrase(value *KopiaServerSecretRefApplyConfiguration) *KopiaServerSecretApplyConfiguration { + b.UserPassphrase = value + return b +} + +// WithTLSCert sets the TLSCert 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 TLSCert field is set to the value of the last call. +func (b *KopiaServerSecretApplyConfiguration) WithTLSCert(value *KopiaServerSecretRefApplyConfiguration) *KopiaServerSecretApplyConfiguration { + b.TLSCert = value + return b +} + +// WithConnectOptions puts the entries into the ConnectOptions 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 ConnectOptions field, +// overwriting an existing map entries in ConnectOptions field with the same key. +func (b *KopiaServerSecretApplyConfiguration) WithConnectOptions(entries map[string]int) *KopiaServerSecretApplyConfiguration { + if b.ConnectOptions == nil && len(entries) > 0 { + b.ConnectOptions = make(map[string]int, len(entries)) + } + for k, v := range entries { + b.ConnectOptions[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecretref.go b/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecretref.go new file mode 100644 index 0000000000..0dbfea54d2 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/kopiaserversecretref.go @@ -0,0 +1,47 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// KopiaServerSecretRefApplyConfiguration represents an declarative configuration of the KopiaServerSecretRef type for use +// with apply. +type KopiaServerSecretRefApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Secret *ObjectReferenceApplyConfiguration `json:"secret,omitempty"` +} + +// KopiaServerSecretRefApplyConfiguration constructs an declarative configuration of the KopiaServerSecretRef type for use with +// apply. +func KopiaServerSecretRef() *KopiaServerSecretRefApplyConfiguration { + return &KopiaServerSecretRefApplyConfiguration{} +} + +// WithKey sets the Key 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 Key field is set to the value of the last call. +func (b *KopiaServerSecretRefApplyConfiguration) WithKey(value string) *KopiaServerSecretRefApplyConfiguration { + b.Key = &value + return b +} + +// WithSecret sets the Secret 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 Secret field is set to the value of the last call. +func (b *KopiaServerSecretRefApplyConfiguration) WithSecret(value *ObjectReferenceApplyConfiguration) *KopiaServerSecretRefApplyConfiguration { + b.Secret = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/location.go b/pkg/client/applyconfiguration/cr/v1alpha1/location.go new file mode 100644 index 0000000000..902f8b55b9 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/location.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" +) + +// LocationApplyConfiguration represents an declarative configuration of the Location type for use +// with apply. +type LocationApplyConfiguration struct { + Type *v1alpha1.LocationType `json:"type,omitempty"` + Bucket *string `json:"bucket,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Prefix *string `json:"prefix,omitempty"` + Region *string `json:"region,omitempty"` +} + +// LocationApplyConfiguration constructs an declarative configuration of the Location type for use with +// apply. +func Location() *LocationApplyConfiguration { + return &LocationApplyConfiguration{} +} + +// 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 *LocationApplyConfiguration) WithType(value v1alpha1.LocationType) *LocationApplyConfiguration { + b.Type = &value + return b +} + +// WithBucket sets the Bucket 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 Bucket field is set to the value of the last call. +func (b *LocationApplyConfiguration) WithBucket(value string) *LocationApplyConfiguration { + b.Bucket = &value + return b +} + +// WithEndpoint sets the Endpoint 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 Endpoint field is set to the value of the last call. +func (b *LocationApplyConfiguration) WithEndpoint(value string) *LocationApplyConfiguration { + b.Endpoint = &value + return b +} + +// WithPrefix sets the Prefix 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 Prefix field is set to the value of the last call. +func (b *LocationApplyConfiguration) WithPrefix(value string) *LocationApplyConfiguration { + b.Prefix = &value + return b +} + +// WithRegion sets the Region 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 Region field is set to the value of the last call. +func (b *LocationApplyConfiguration) WithRegion(value string) *LocationApplyConfiguration { + b.Region = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/objectreference.go b/pkg/client/applyconfiguration/cr/v1alpha1/objectreference.go new file mode 100644 index 0000000000..0d82469d64 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/objectreference.go @@ -0,0 +1,83 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// with apply. +type ObjectReferenceApplyConfiguration struct { + APIVersion *string `json:"apiVersion,omitempty"` + Group *string `json:"group,omitempty"` + Resource *string `json:"resource,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// apply. +func ObjectReference() *ObjectReferenceApplyConfiguration { + return &ObjectReferenceApplyConfiguration{} +} + +// 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 *ObjectReferenceApplyConfiguration) WithAPIVersion(value string) *ObjectReferenceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithGroup sets the Group 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 Group field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithGroup(value string) *ObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithResource sets the Resource 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 Resource field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithResource(value string) *ObjectReferenceApplyConfiguration { + b.Resource = &value + 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 *ObjectReferenceApplyConfiguration) WithKind(value string) *ObjectReferenceApplyConfiguration { + b.Kind = &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 *ObjectReferenceApplyConfiguration) WithName(value string) *ObjectReferenceApplyConfiguration { + b.Name = &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 *ObjectReferenceApplyConfiguration) WithNamespace(value string) *ObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/phase.go b/pkg/client/applyconfiguration/cr/v1alpha1/phase.go new file mode 100644 index 0000000000..02e3c53704 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/phase.go @@ -0,0 +1,75 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" +) + +// PhaseApplyConfiguration represents an declarative configuration of the Phase type for use +// with apply. +type PhaseApplyConfiguration struct { + Name *string `json:"name,omitempty"` + State *v1alpha1.State `json:"state,omitempty"` + Output map[string]interface{} `json:"output,omitempty"` + Progress *PhaseProgressApplyConfiguration `json:"progress,omitempty"` +} + +// PhaseApplyConfiguration constructs an declarative configuration of the Phase type for use with +// apply. +func Phase() *PhaseApplyConfiguration { + return &PhaseApplyConfiguration{} +} + +// 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 *PhaseApplyConfiguration) WithName(value string) *PhaseApplyConfiguration { + b.Name = &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 *PhaseApplyConfiguration) WithState(value v1alpha1.State) *PhaseApplyConfiguration { + b.State = &value + return b +} + +// WithOutput puts the entries into the Output 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 Output field, +// overwriting an existing map entries in Output field with the same key. +func (b *PhaseApplyConfiguration) WithOutput(entries map[string]interface{}) *PhaseApplyConfiguration { + if b.Output == nil && len(entries) > 0 { + b.Output = make(map[string]interface{}, len(entries)) + } + for k, v := range entries { + b.Output[k] = v + } + return b +} + +// WithProgress sets the Progress 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 Progress field is set to the value of the last call. +func (b *PhaseApplyConfiguration) WithProgress(value *PhaseProgressApplyConfiguration) *PhaseApplyConfiguration { + b.Progress = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/phaseprogress.go b/pkg/client/applyconfiguration/cr/v1alpha1/phaseprogress.go new file mode 100644 index 0000000000..eac22c4c2a --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/phaseprogress.go @@ -0,0 +1,96 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PhaseProgressApplyConfiguration represents an declarative configuration of the PhaseProgress type for use +// with apply. +type PhaseProgressApplyConfiguration struct { + ProgressPercent *string `json:"progressPercent,omitempty"` + SizeDownloadedB *int64 `json:"sizeDownloadedB,omitempty"` + SizeUploadedB *int64 `json:"sizeUploadedB,omitempty"` + EstimatedDownloadSizeB *int64 `json:"estimatedDownloadSizeB,omitempty"` + EstimatedUploadSizeB *int64 `json:"estimatedUploadSizeB,omitempty"` + EstimatedTimeSeconds *int64 `json:"estinatedTimeSeconds,omitempty"` + LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` +} + +// PhaseProgressApplyConfiguration constructs an declarative configuration of the PhaseProgress type for use with +// apply. +func PhaseProgress() *PhaseProgressApplyConfiguration { + return &PhaseProgressApplyConfiguration{} +} + +// WithProgressPercent sets the ProgressPercent 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 ProgressPercent field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithProgressPercent(value string) *PhaseProgressApplyConfiguration { + b.ProgressPercent = &value + return b +} + +// WithSizeDownloadedB sets the SizeDownloadedB 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 SizeDownloadedB field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithSizeDownloadedB(value int64) *PhaseProgressApplyConfiguration { + b.SizeDownloadedB = &value + return b +} + +// WithSizeUploadedB sets the SizeUploadedB 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 SizeUploadedB field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithSizeUploadedB(value int64) *PhaseProgressApplyConfiguration { + b.SizeUploadedB = &value + return b +} + +// WithEstimatedDownloadSizeB sets the EstimatedDownloadSizeB 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 EstimatedDownloadSizeB field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithEstimatedDownloadSizeB(value int64) *PhaseProgressApplyConfiguration { + b.EstimatedDownloadSizeB = &value + return b +} + +// WithEstimatedUploadSizeB sets the EstimatedUploadSizeB 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 EstimatedUploadSizeB field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithEstimatedUploadSizeB(value int64) *PhaseProgressApplyConfiguration { + b.EstimatedUploadSizeB = &value + return b +} + +// WithEstimatedTimeSeconds sets the EstimatedTimeSeconds 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 EstimatedTimeSeconds field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithEstimatedTimeSeconds(value int64) *PhaseProgressApplyConfiguration { + b.EstimatedTimeSeconds = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value of the last call. +func (b *PhaseProgressApplyConfiguration) WithLastTransitionTime(value v1.Time) *PhaseProgressApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/profile.go b/pkg/client/applyconfiguration/cr/v1alpha1/profile.go new file mode 100644 index 0000000000..19434dd782 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/profile.go @@ -0,0 +1,227 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ProfileApplyConfiguration represents an declarative configuration of the Profile type for use +// with apply. +type ProfileApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Location *LocationApplyConfiguration `json:"location,omitempty"` + Credential *CredentialApplyConfiguration `json:"credential,omitempty"` + SkipSSLVerify *bool `json:"skipSSLVerify,omitempty"` +} + +// Profile constructs an declarative configuration of the Profile type for use with +// apply. +func Profile(name, namespace string) *ProfileApplyConfiguration { + b := &ProfileApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Profile") + b.WithAPIVersion("cr.kanister.io/v1alpha1") + 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 *ProfileApplyConfiguration) WithKind(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithAPIVersion(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithName(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithGenerateName(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithNamespace(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithUID(value types.UID) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithResourceVersion(value string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithGeneration(value int64) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithLabels(entries map[string]string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithAnnotations(entries map[string]string) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ProfileApplyConfiguration { + 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 *ProfileApplyConfiguration) WithFinalizers(values ...string) *ProfileApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ProfileApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithLocation sets the Location 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 Location field is set to the value of the last call. +func (b *ProfileApplyConfiguration) WithLocation(value *LocationApplyConfiguration) *ProfileApplyConfiguration { + b.Location = value + return b +} + +// WithCredential sets the Credential 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 Credential field is set to the value of the last call. +func (b *ProfileApplyConfiguration) WithCredential(value *CredentialApplyConfiguration) *ProfileApplyConfiguration { + b.Credential = value + return b +} + +// WithSkipSSLVerify sets the SkipSSLVerify 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 SkipSSLVerify field is set to the value of the last call. +func (b *ProfileApplyConfiguration) WithSkipSSLVerify(value bool) *ProfileApplyConfiguration { + b.SkipSSLVerify = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/repository.go b/pkg/client/applyconfiguration/cr/v1alpha1/repository.go new file mode 100644 index 0000000000..c7584d385f --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/repository.go @@ -0,0 +1,87 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// RepositoryApplyConfiguration represents an declarative configuration of the Repository type for use +// with apply. +type RepositoryApplyConfiguration struct { + RootPath *string `json:"rootPath,omitempty"` + Username *string `json:"username,omitempty"` + Hostname *string `json:"hostname,omitempty"` + PasswordSecretRef *v1.SecretReference `json:"passwordSecretRef,omitempty"` + CacheSizeSettings *CacheSizeSettingsApplyConfiguration `json:"cacheSizeSettings,omitempty"` + Configuration *ConfigurationApplyConfiguration `json:"configuration,omitempty"` +} + +// RepositoryApplyConfiguration constructs an declarative configuration of the Repository type for use with +// apply. +func Repository() *RepositoryApplyConfiguration { + return &RepositoryApplyConfiguration{} +} + +// WithRootPath sets the RootPath 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 RootPath field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithRootPath(value string) *RepositoryApplyConfiguration { + b.RootPath = &value + return b +} + +// WithUsername sets the Username 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 Username field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithUsername(value string) *RepositoryApplyConfiguration { + b.Username = &value + return b +} + +// WithHostname sets the Hostname 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 Hostname field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithHostname(value string) *RepositoryApplyConfiguration { + b.Hostname = &value + return b +} + +// WithPasswordSecretRef sets the PasswordSecretRef 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 PasswordSecretRef field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithPasswordSecretRef(value v1.SecretReference) *RepositoryApplyConfiguration { + b.PasswordSecretRef = &value + return b +} + +// WithCacheSizeSettings sets the CacheSizeSettings 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 CacheSizeSettings field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithCacheSizeSettings(value *CacheSizeSettingsApplyConfiguration) *RepositoryApplyConfiguration { + b.CacheSizeSettings = value + return b +} + +// WithConfiguration sets the Configuration 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 Configuration field is set to the value of the last call. +func (b *RepositoryApplyConfiguration) WithConfiguration(value *ConfigurationApplyConfiguration) *RepositoryApplyConfiguration { + b.Configuration = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserver.go b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserver.go new file mode 100644 index 0000000000..179c580712 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserver.go @@ -0,0 +1,218 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// RepositoryServerApplyConfiguration represents an declarative configuration of the RepositoryServer type for use +// with apply. +type RepositoryServerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *RepositoryServerSpecApplyConfiguration `json:"spec,omitempty"` + Status *RepositoryServerStatusApplyConfiguration `json:"status,omitempty"` +} + +// RepositoryServer constructs an declarative configuration of the RepositoryServer type for use with +// apply. +func RepositoryServer(name, namespace string) *RepositoryServerApplyConfiguration { + b := &RepositoryServerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("RepositoryServer") + b.WithAPIVersion("cr.kanister.io/v1alpha1") + 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 *RepositoryServerApplyConfiguration) WithKind(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithAPIVersion(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithName(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithGenerateName(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithNamespace(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithUID(value types.UID) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithResourceVersion(value string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithGeneration(value int64) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithLabels(entries map[string]string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithAnnotations(entries map[string]string) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithFinalizers(values ...string) *RepositoryServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *RepositoryServerApplyConfiguration) 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 *RepositoryServerApplyConfiguration) WithSpec(value *RepositoryServerSpecApplyConfiguration) *RepositoryServerApplyConfiguration { + 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 *RepositoryServerApplyConfiguration) WithStatus(value *RepositoryServerStatusApplyConfiguration) *RepositoryServerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverspec.go b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverspec.go new file mode 100644 index 0000000000..5358fe14cd --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverspec.go @@ -0,0 +1,56 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// RepositoryServerSpecApplyConfiguration represents an declarative configuration of the RepositoryServerSpec type for use +// with apply. +type RepositoryServerSpecApplyConfiguration struct { + Storage *StorageApplyConfiguration `json:"storage,omitempty"` + Repository *RepositoryApplyConfiguration `json:"repository,omitempty"` + Server *ServerApplyConfiguration `json:"server,omitempty"` +} + +// RepositoryServerSpecApplyConfiguration constructs an declarative configuration of the RepositoryServerSpec type for use with +// apply. +func RepositoryServerSpec() *RepositoryServerSpecApplyConfiguration { + return &RepositoryServerSpecApplyConfiguration{} +} + +// WithStorage sets the Storage 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 Storage field is set to the value of the last call. +func (b *RepositoryServerSpecApplyConfiguration) WithStorage(value *StorageApplyConfiguration) *RepositoryServerSpecApplyConfiguration { + b.Storage = value + return b +} + +// WithRepository sets the Repository 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 Repository field is set to the value of the last call. +func (b *RepositoryServerSpecApplyConfiguration) WithRepository(value *RepositoryApplyConfiguration) *RepositoryServerSpecApplyConfiguration { + b.Repository = value + return b +} + +// WithServer sets the Server 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 Server field is set to the value of the last call. +func (b *RepositoryServerSpecApplyConfiguration) WithServer(value *ServerApplyConfiguration) *RepositoryServerSpecApplyConfiguration { + b.Server = value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go new file mode 100644 index 0000000000..7064fc0dd4 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go @@ -0,0 +1,63 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// RepositoryServerStatusApplyConfiguration represents an declarative configuration of the RepositoryServerStatus type for use +// with apply. +type RepositoryServerStatusApplyConfiguration struct { + Conditions []v1.Condition `json:"conditions,omitempty"` + ServerInfo *ServerInfoApplyConfiguration `json:"serverInfo,omitempty"` + Progress *crv1alpha1.RepositoryServerProgress `json:"progress,omitempty"` +} + +// RepositoryServerStatusApplyConfiguration constructs an declarative configuration of the RepositoryServerStatus type for use with +// apply. +func RepositoryServerStatus() *RepositoryServerStatusApplyConfiguration { + return &RepositoryServerStatusApplyConfiguration{} +} + +// 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 *RepositoryServerStatusApplyConfiguration) WithConditions(values ...v1.Condition) *RepositoryServerStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} + +// WithServerInfo sets the ServerInfo 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 ServerInfo field is set to the value of the last call. +func (b *RepositoryServerStatusApplyConfiguration) WithServerInfo(value *ServerInfoApplyConfiguration) *RepositoryServerStatusApplyConfiguration { + b.ServerInfo = value + return b +} + +// WithProgress sets the Progress 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 Progress field is set to the value of the last call. +func (b *RepositoryServerStatusApplyConfiguration) WithProgress(value crv1alpha1.RepositoryServerProgress) *RepositoryServerStatusApplyConfiguration { + b.Progress = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/server.go b/pkg/client/applyconfiguration/cr/v1alpha1/server.go new file mode 100644 index 0000000000..4bfac56eb4 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/server.go @@ -0,0 +1,60 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ServerApplyConfiguration represents an declarative configuration of the Server type for use +// with apply. +type ServerApplyConfiguration struct { + UserAccess *UserAccessApplyConfiguration `json:"userAccess,omitempty"` + AdminSecretRef *v1.SecretReference `json:"adminSecretRef,omitempty"` + TLSSecretRef *v1.SecretReference `json:"tlsSecretRef,omitempty"` +} + +// ServerApplyConfiguration constructs an declarative configuration of the Server type for use with +// apply. +func Server() *ServerApplyConfiguration { + return &ServerApplyConfiguration{} +} + +// WithUserAccess sets the UserAccess 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 UserAccess field is set to the value of the last call. +func (b *ServerApplyConfiguration) WithUserAccess(value *UserAccessApplyConfiguration) *ServerApplyConfiguration { + b.UserAccess = value + return b +} + +// WithAdminSecretRef sets the AdminSecretRef 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 AdminSecretRef field is set to the value of the last call. +func (b *ServerApplyConfiguration) WithAdminSecretRef(value v1.SecretReference) *ServerApplyConfiguration { + b.AdminSecretRef = &value + return b +} + +// WithTLSSecretRef sets the TLSSecretRef 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 TLSSecretRef field is set to the value of the last call. +func (b *ServerApplyConfiguration) WithTLSSecretRef(value v1.SecretReference) *ServerApplyConfiguration { + b.TLSSecretRef = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/serverinfo.go b/pkg/client/applyconfiguration/cr/v1alpha1/serverinfo.go new file mode 100644 index 0000000000..7e4ac42b8d --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/serverinfo.go @@ -0,0 +1,47 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +// ServerInfoApplyConfiguration represents an declarative configuration of the ServerInfo type for use +// with apply. +type ServerInfoApplyConfiguration struct { + PodName *string `json:"podName,omitempty"` + ServiceName *string `json:"serviceName,omitempty"` +} + +// ServerInfoApplyConfiguration constructs an declarative configuration of the ServerInfo type for use with +// apply. +func ServerInfo() *ServerInfoApplyConfiguration { + return &ServerInfoApplyConfiguration{} +} + +// 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 *ServerInfoApplyConfiguration) WithPodName(value string) *ServerInfoApplyConfiguration { + b.PodName = &value + return b +} + +// WithServiceName sets the ServiceName 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 ServiceName field is set to the value of the last call. +func (b *ServerInfoApplyConfiguration) WithServiceName(value string) *ServerInfoApplyConfiguration { + b.ServiceName = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/storage.go b/pkg/client/applyconfiguration/cr/v1alpha1/storage.go new file mode 100644 index 0000000000..51cd354c88 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/storage.go @@ -0,0 +1,51 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// StorageApplyConfiguration represents an declarative configuration of the Storage type for use +// with apply. +type StorageApplyConfiguration struct { + SecretRef *v1.SecretReference `json:"secretRef,omitempty"` + CredentialSecretRef *v1.SecretReference `json:"credentialSecretRef,omitempty"` +} + +// StorageApplyConfiguration constructs an declarative configuration of the Storage type for use with +// apply. +func Storage() *StorageApplyConfiguration { + return &StorageApplyConfiguration{} +} + +// WithSecretRef sets the SecretRef 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 SecretRef field is set to the value of the last call. +func (b *StorageApplyConfiguration) WithSecretRef(value v1.SecretReference) *StorageApplyConfiguration { + b.SecretRef = &value + return b +} + +// WithCredentialSecretRef sets the CredentialSecretRef 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 CredentialSecretRef field is set to the value of the last call. +func (b *StorageApplyConfiguration) WithCredentialSecretRef(value v1.SecretReference) *StorageApplyConfiguration { + b.CredentialSecretRef = &value + return b +} diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/useraccess.go b/pkg/client/applyconfiguration/cr/v1alpha1/useraccess.go new file mode 100644 index 0000000000..46bbcc4bd3 --- /dev/null +++ b/pkg/client/applyconfiguration/cr/v1alpha1/useraccess.go @@ -0,0 +1,51 @@ +/* +Copyright 2024 The Kanister 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 v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// UserAccessApplyConfiguration represents an declarative configuration of the UserAccess type for use +// with apply. +type UserAccessApplyConfiguration struct { + UserAccessSecretRef *v1.SecretReference `json:"userAccessSecretRef,omitempty"` + Username *string `json:"username,omitempty"` +} + +// UserAccessApplyConfiguration constructs an declarative configuration of the UserAccess type for use with +// apply. +func UserAccess() *UserAccessApplyConfiguration { + return &UserAccessApplyConfiguration{} +} + +// WithUserAccessSecretRef sets the UserAccessSecretRef 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 UserAccessSecretRef field is set to the value of the last call. +func (b *UserAccessApplyConfiguration) WithUserAccessSecretRef(value v1.SecretReference) *UserAccessApplyConfiguration { + b.UserAccessSecretRef = &value + return b +} + +// WithUsername sets the Username 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 Username field is set to the value of the last call. +func (b *UserAccessApplyConfiguration) WithUsername(value string) *UserAccessApplyConfiguration { + b.Username = &value + return b +} diff --git a/pkg/client/applyconfiguration/internal/internal.go b/pkg/client/applyconfiguration/internal/internal.go new file mode 100644 index 0000000000..4bb9c4f476 --- /dev/null +++ b/pkg/client/applyconfiguration/internal/internal.go @@ -0,0 +1,61 @@ +/* +Copyright 2024 The Kanister 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 0000000000..9e2fde8eff --- /dev/null +++ b/pkg/client/applyconfiguration/utils.go @@ -0,0 +1,94 @@ +/* +Copyright 2024 The Kanister 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 ( + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" + 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=cr.kanister.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("ActionProgress"): + return &crv1alpha1.ActionProgressApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ActionSet"): + return &crv1alpha1.ActionSetApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ActionSetSpec"): + return &crv1alpha1.ActionSetSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ActionSetStatus"): + return &crv1alpha1.ActionSetStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ActionSpec"): + return &crv1alpha1.ActionSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ActionStatus"): + return &crv1alpha1.ActionStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Artifact"): + return &crv1alpha1.ArtifactApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Blueprint"): + return &crv1alpha1.BlueprintApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("BlueprintAction"): + return &crv1alpha1.BlueprintActionApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("BlueprintPhase"): + return &crv1alpha1.BlueprintPhaseApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("CacheSizeSettings"): + return &crv1alpha1.CacheSizeSettingsApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Configuration"): + return &crv1alpha1.ConfigurationApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Credential"): + return &crv1alpha1.CredentialApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Error"): + return &crv1alpha1.ErrorApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KeyPair"): + return &crv1alpha1.KeyPairApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KopiaServerSecret"): + return &crv1alpha1.KopiaServerSecretApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("KopiaServerSecretRef"): + return &crv1alpha1.KopiaServerSecretRefApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Location"): + return &crv1alpha1.LocationApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ObjectReference"): + return &crv1alpha1.ObjectReferenceApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Phase"): + return &crv1alpha1.PhaseApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("PhaseProgress"): + return &crv1alpha1.PhaseProgressApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Profile"): + return &crv1alpha1.ProfileApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Repository"): + return &crv1alpha1.RepositoryApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("RepositoryServer"): + return &crv1alpha1.RepositoryServerApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("RepositoryServerSpec"): + return &crv1alpha1.RepositoryServerSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("RepositoryServerStatus"): + return &crv1alpha1.RepositoryServerStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Server"): + return &crv1alpha1.ServerApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ServerInfo"): + return &crv1alpha1.ServerInfoApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Storage"): + return &crv1alpha1.StorageApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("UserAccess"): + return &crv1alpha1.UserAccessApplyConfiguration{} + + } + return nil +} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 75e61fe007..480e735da8 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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. package versioned @@ -22,11 +21,10 @@ import ( "fmt" "net/http" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" - - crv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" ) type Interface interface { diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index c14a83d0b6..f39137cf07 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,21 +13,19 @@ 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. package fake import ( + clientset "github.com/kanisterio/kanister/pkg/client/clientset/versioned" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" + fakecrv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" - - clientset "github.com/kanisterio/kanister/pkg/client/clientset/versioned" - crv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" - fakecrv1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index 9b99e71670..d55f03ca92 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 fake clientset. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 6701de301f..ce3d68fac1 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,19 +13,17 @@ 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. package fake import ( + crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) var scheme = runtime.NewScheme() diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index 7dc3756168..1f972c545c 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 contains the scheme of the automatically generated clientset. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 6b0f66c9b3..712f742f6e 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,19 +13,17 @@ 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. package scheme import ( + crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) var Scheme = runtime.NewScheme() diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/actionset.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/actionset.go index 95771c23c8..10a80d9c5d 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/actionset.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/actionset.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,23 @@ 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. package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" + scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" - scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" ) // ActionSetsGetter has a method to return a ActionSetInterface. @@ -47,6 +48,7 @@ type ActionSetInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ActionSetList, 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.ActionSet, err error) + Apply(ctx context.Context, actionSet *crv1alpha1.ActionSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ActionSet, err error) ActionSetExpansion } @@ -177,3 +179,29 @@ func (c *actionSets) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied actionSet. +func (c *actionSets) Apply(ctx context.Context, actionSet *crv1alpha1.ActionSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ActionSet, err error) { + if actionSet == nil { + return nil, fmt.Errorf("actionSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(actionSet) + if err != nil { + return nil, err + } + name := actionSet.Name + if name == nil { + return nil, fmt.Errorf("actionSet.Name must be provided to Apply") + } + result = &v1alpha1.ActionSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("actionsets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/blueprint.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/blueprint.go index e3bf9cf982..aa2dbe58d0 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/blueprint.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/blueprint.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,23 @@ 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. package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" + scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" - scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" ) // BlueprintsGetter has a method to return a BlueprintInterface. @@ -47,6 +48,7 @@ type BlueprintInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BlueprintList, 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.Blueprint, err error) + Apply(ctx context.Context, blueprint *crv1alpha1.BlueprintApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Blueprint, err error) BlueprintExpansion } @@ -177,3 +179,29 @@ func (c *blueprints) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied blueprint. +func (c *blueprints) Apply(ctx context.Context, blueprint *crv1alpha1.BlueprintApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Blueprint, err error) { + if blueprint == nil { + return nil, fmt.Errorf("blueprint provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(blueprint) + if err != nil { + return nil, err + } + name := blueprint.Name + if name == nil { + return nil, fmt.Errorf("blueprint.Name must be provided to Apply") + } + result = &v1alpha1.Blueprint{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("blueprints"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/cr_client.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/cr_client.go index 4d2ff6a346..fcb81b1ec9 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/cr_client.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/cr_client.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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. package v1alpha1 @@ -21,10 +20,9 @@ package v1alpha1 import ( "net/http" - rest "k8s.io/client-go/rest" - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" ) type CrV1alpha1Interface interface { diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/doc.go index df51baa4d4..f8245a40c4 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 typed clients. diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/doc.go index 16f4439906..f470b6f479 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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. // Package fake has the automatically generated clients. diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_actionset.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_actionset.go index 202b9cbfa1..e946100581 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_actionset.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_actionset.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,22 @@ 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. package fake import ( "context" + json "encoding/json" + "fmt" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // FakeActionSets implements ActionSetInterface @@ -37,9 +37,9 @@ type FakeActionSets struct { ns string } -var actionsetsResource = schema.GroupVersionResource{Group: "cr.kanister.io", Version: "v1alpha1", Resource: "actionsets"} +var actionsetsResource = v1alpha1.SchemeGroupVersion.WithResource("actionsets") -var actionsetsKind = schema.GroupVersionKind{Group: "cr.kanister.io", Version: "v1alpha1", Kind: "ActionSet"} +var actionsetsKind = v1alpha1.SchemeGroupVersion.WithKind("ActionSet") // Get takes name of the actionSet, and returns the corresponding actionSet object, and an error if there is any. func (c *FakeActionSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ActionSet, err error) { @@ -129,3 +129,25 @@ func (c *FakeActionSets) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1alpha1.ActionSet), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied actionSet. +func (c *FakeActionSets) Apply(ctx context.Context, actionSet *crv1alpha1.ActionSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ActionSet, err error) { + if actionSet == nil { + return nil, fmt.Errorf("actionSet provided to Apply must not be nil") + } + data, err := json.Marshal(actionSet) + if err != nil { + return nil, err + } + name := actionSet.Name + if name == nil { + return nil, fmt.Errorf("actionSet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(actionsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.ActionSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ActionSet), err +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_blueprint.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_blueprint.go index 7784d7e711..5ec51d78bc 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_blueprint.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_blueprint.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,22 @@ 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. package fake import ( "context" + json "encoding/json" + "fmt" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // FakeBlueprints implements BlueprintInterface @@ -37,9 +37,9 @@ type FakeBlueprints struct { ns string } -var blueprintsResource = schema.GroupVersionResource{Group: "cr.kanister.io", Version: "v1alpha1", Resource: "blueprints"} +var blueprintsResource = v1alpha1.SchemeGroupVersion.WithResource("blueprints") -var blueprintsKind = schema.GroupVersionKind{Group: "cr.kanister.io", Version: "v1alpha1", Kind: "Blueprint"} +var blueprintsKind = v1alpha1.SchemeGroupVersion.WithKind("Blueprint") // Get takes name of the blueprint, and returns the corresponding blueprint object, and an error if there is any. func (c *FakeBlueprints) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Blueprint, err error) { @@ -129,3 +129,25 @@ func (c *FakeBlueprints) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1alpha1.Blueprint), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied blueprint. +func (c *FakeBlueprints) Apply(ctx context.Context, blueprint *crv1alpha1.BlueprintApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Blueprint, err error) { + if blueprint == nil { + return nil, fmt.Errorf("blueprint provided to Apply must not be nil") + } + data, err := json.Marshal(blueprint) + if err != nil { + return nil, err + } + name := blueprint.Name + if name == nil { + return nil, fmt.Errorf("blueprint.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(blueprintsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Blueprint{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Blueprint), err +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_cr_client.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_cr_client.go index dafc3cca0d..ac97a3373e 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_cr_client.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_cr_client.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,16 +13,14 @@ 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. package fake import ( + v1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - - v1alpha1 "github.com/kanisterio/kanister/pkg/client/clientset/versioned/typed/cr/v1alpha1" ) type FakeCrV1alpha1 struct { diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_profile.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_profile.go index ba832bf1a8..d5aeb5fb26 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_profile.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_profile.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,22 @@ 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. package fake import ( "context" + json "encoding/json" + "fmt" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // FakeProfiles implements ProfileInterface @@ -37,9 +37,9 @@ type FakeProfiles struct { ns string } -var profilesResource = schema.GroupVersionResource{Group: "cr.kanister.io", Version: "v1alpha1", Resource: "profiles"} +var profilesResource = v1alpha1.SchemeGroupVersion.WithResource("profiles") -var profilesKind = schema.GroupVersionKind{Group: "cr.kanister.io", Version: "v1alpha1", Kind: "Profile"} +var profilesKind = v1alpha1.SchemeGroupVersion.WithKind("Profile") // Get takes name of the profile, and returns the corresponding profile object, and an error if there is any. func (c *FakeProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Profile, err error) { @@ -129,3 +129,25 @@ func (c *FakeProfiles) Patch(ctx context.Context, name string, pt types.PatchTyp } return obj.(*v1alpha1.Profile), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied profile. +func (c *FakeProfiles) Apply(ctx context.Context, profile *crv1alpha1.ProfileApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Profile, err error) { + if profile == nil { + return nil, fmt.Errorf("profile provided to Apply must not be nil") + } + data, err := json.Marshal(profile) + if err != nil { + return nil, err + } + name := profile.Name + if name == nil { + return nil, fmt.Errorf("profile.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(profilesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Profile{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Profile), err +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_repositoryserver.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_repositoryserver.go index be3ffab08c..a9e0c69d6a 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_repositoryserver.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/fake/fake_repositoryserver.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,22 @@ 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. package fake import ( "context" + json "encoding/json" + "fmt" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // FakeRepositoryServers implements RepositoryServerInterface @@ -37,9 +37,9 @@ type FakeRepositoryServers struct { ns string } -var repositoryserversResource = schema.GroupVersionResource{Group: "cr.kanister.io", Version: "v1alpha1", Resource: "repositoryservers"} +var repositoryserversResource = v1alpha1.SchemeGroupVersion.WithResource("repositoryservers") -var repositoryserversKind = schema.GroupVersionKind{Group: "cr.kanister.io", Version: "v1alpha1", Kind: "RepositoryServer"} +var repositoryserversKind = v1alpha1.SchemeGroupVersion.WithKind("RepositoryServer") // Get takes name of the repositoryServer, and returns the corresponding repositoryServer object, and an error if there is any. func (c *FakeRepositoryServers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RepositoryServer, err error) { @@ -141,3 +141,48 @@ func (c *FakeRepositoryServers) Patch(ctx context.Context, name string, pt types } return obj.(*v1alpha1.RepositoryServer), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied repositoryServer. +func (c *FakeRepositoryServers) Apply(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) { + if repositoryServer == nil { + return nil, fmt.Errorf("repositoryServer provided to Apply must not be nil") + } + data, err := json.Marshal(repositoryServer) + if err != nil { + return nil, err + } + name := repositoryServer.Name + if name == nil { + return nil, fmt.Errorf("repositoryServer.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(repositoryserversResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.RepositoryServer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RepositoryServer), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeRepositoryServers) ApplyStatus(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) { + if repositoryServer == nil { + return nil, fmt.Errorf("repositoryServer provided to Apply must not be nil") + } + data, err := json.Marshal(repositoryServer) + if err != nil { + return nil, err + } + name := repositoryServer.Name + if name == nil { + return nil, fmt.Errorf("repositoryServer.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(repositoryserversResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.RepositoryServer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.RepositoryServer), err +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/generated_expansion.go index 0b7fa7f3ea..b1228c54d2 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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. package v1alpha1 diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/profile.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/profile.go index 340368916a..cf9d783485 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/profile.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/profile.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,23 @@ 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. package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" + scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" - scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" ) // ProfilesGetter has a method to return a ProfileInterface. @@ -47,6 +48,7 @@ type ProfileInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ProfileList, 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.Profile, err error) + Apply(ctx context.Context, profile *crv1alpha1.ProfileApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Profile, err error) ProfileExpansion } @@ -177,3 +179,29 @@ func (c *profiles) Patch(ctx context.Context, name string, pt types.PatchType, d Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied profile. +func (c *profiles) Apply(ctx context.Context, profile *crv1alpha1.ProfileApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Profile, err error) { + if profile == nil { + return nil, fmt.Errorf("profile provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(profile) + if err != nil { + return nil, err + } + name := profile.Name + if name == nil { + return nil, fmt.Errorf("profile.Name must be provided to Apply") + } + result = &v1alpha1.Profile{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("profiles"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/cr/v1alpha1/repositoryserver.go b/pkg/client/clientset/versioned/typed/cr/v1alpha1/repositoryserver.go index 0c4df5ac33..e823cab890 100644 --- a/pkg/client/clientset/versioned/typed/cr/v1alpha1/repositoryserver.go +++ b/pkg/client/clientset/versioned/typed/cr/v1alpha1/repositoryserver.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,22 +13,23 @@ 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. package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + crv1alpha1 "github.com/kanisterio/kanister/pkg/client/applyconfiguration/cr/v1alpha1" + scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" 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" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" - scheme "github.com/kanisterio/kanister/pkg/client/clientset/versioned/scheme" ) // RepositoryServersGetter has a method to return a RepositoryServerInterface. @@ -48,6 +49,8 @@ type RepositoryServerInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RepositoryServerList, 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.RepositoryServer, err error) + Apply(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) + ApplyStatus(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) RepositoryServerExpansion } @@ -194,3 +197,59 @@ func (c *repositoryServers) Patch(ctx context.Context, name string, pt types.Pat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied repositoryServer. +func (c *repositoryServers) Apply(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) { + if repositoryServer == nil { + return nil, fmt.Errorf("repositoryServer provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(repositoryServer) + if err != nil { + return nil, err + } + name := repositoryServer.Name + if name == nil { + return nil, fmt.Errorf("repositoryServer.Name must be provided to Apply") + } + result = &v1alpha1.RepositoryServer{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("repositoryservers"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *repositoryServers) ApplyStatus(ctx context.Context, repositoryServer *crv1alpha1.RepositoryServerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RepositoryServer, err error) { + if repositoryServer == nil { + return nil, fmt.Errorf("repositoryServer provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(repositoryServer) + if err != nil { + return nil, err + } + + name := repositoryServer.Name + if name == nil { + return nil, fmt.Errorf("repositoryServer.Name must be provided to Apply") + } + + result = &v1alpha1.RepositoryServer{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("repositoryservers"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/informers/externalversions/cr/interface.go b/pkg/client/informers/externalversions/cr/interface.go index 2608d2dd1a..49d7563820 100644 --- a/pkg/client/informers/externalversions/cr/interface.go +++ b/pkg/client/informers/externalversions/cr/interface.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package cr diff --git a/pkg/client/informers/externalversions/cr/v1alpha1/actionset.go b/pkg/client/informers/externalversions/cr/v1alpha1/actionset.go index 8edf14aed2..9a932ca1e0 100644 --- a/pkg/client/informers/externalversions/cr/v1alpha1/actionset.go +++ b/pkg/client/informers/externalversions/cr/v1alpha1/actionset.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package v1alpha1 @@ -22,15 +21,14 @@ import ( "context" time "time" - 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" - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/kanisterio/kanister/pkg/client/listers/cr/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" ) // ActionSetInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/cr/v1alpha1/blueprint.go b/pkg/client/informers/externalversions/cr/v1alpha1/blueprint.go index 0c1287ea39..29d5664902 100644 --- a/pkg/client/informers/externalversions/cr/v1alpha1/blueprint.go +++ b/pkg/client/informers/externalversions/cr/v1alpha1/blueprint.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package v1alpha1 @@ -22,15 +21,14 @@ import ( "context" time "time" - 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" - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/kanisterio/kanister/pkg/client/listers/cr/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" ) // BlueprintInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/cr/v1alpha1/interface.go b/pkg/client/informers/externalversions/cr/v1alpha1/interface.go index 20244b5217..f7bff726b9 100644 --- a/pkg/client/informers/externalversions/cr/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/cr/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/client/informers/externalversions/cr/v1alpha1/profile.go b/pkg/client/informers/externalversions/cr/v1alpha1/profile.go index d65368a637..bc1f032972 100644 --- a/pkg/client/informers/externalversions/cr/v1alpha1/profile.go +++ b/pkg/client/informers/externalversions/cr/v1alpha1/profile.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package v1alpha1 @@ -22,15 +21,14 @@ import ( "context" time "time" - 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" - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/kanisterio/kanister/pkg/client/listers/cr/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" ) // ProfileInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/cr/v1alpha1/repositoryserver.go b/pkg/client/informers/externalversions/cr/v1alpha1/repositoryserver.go index 6ce6cb0c88..ad9412cb6b 100644 --- a/pkg/client/informers/externalversions/cr/v1alpha1/repositoryserver.go +++ b/pkg/client/informers/externalversions/cr/v1alpha1/repositoryserver.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kanister Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package v1alpha1 @@ -22,15 +21,14 @@ import ( "context" time "time" - 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" - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/kanisterio/kanister/pkg/client/listers/cr/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" ) // RepositoryServerInformer provides access to a shared informer and lister for diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 3c8ecbcee1..4e6cb8b09d 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package externalversions @@ -23,14 +22,13 @@ import ( sync "sync" time "time" + versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" + cr "github.com/kanisterio/kanister/pkg/client/informers/externalversions/cr" + internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - - versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" - cr "github.com/kanisterio/kanister/pkg/client/informers/externalversions/cr" - internalinterfaces "github.com/kanisterio/kanister/pkg/client/informers/externalversions/internalinterfaces" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. @@ -43,6 +41,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -81,6 +80,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -167,7 +174,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -185,6 +192,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -240,7 +248,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index a0de4c8653..68b95184b3 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package externalversions @@ -21,10 +20,9 @@ package externalversions import ( "fmt" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index fd43ef8630..5855107c20 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 informer-gen. DO NOT EDIT. package internalinterfaces @@ -21,11 +20,10 @@ package internalinterfaces import ( time "time" + versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" - - versioned "github.com/kanisterio/kanister/pkg/client/clientset/versioned" ) // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. diff --git a/pkg/client/listers/cr/v1alpha1/actionset.go b/pkg/client/listers/cr/v1alpha1/actionset.go index 1530fb8616..7f0ccf206b 100644 --- a/pkg/client/listers/cr/v1alpha1/actionset.go +++ b/pkg/client/listers/cr/v1alpha1/actionset.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,17 +13,15 @@ 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 ( - apierrors "k8s.io/apimachinery/pkg/api/errors" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // ActionSetLister helps list ActionSets. @@ -94,7 +92,7 @@ func (s actionSetNamespaceLister) Get(name string) (*v1alpha1.ActionSet, error) return nil, err } if !exists { - return nil, apierrors.NewNotFound(v1alpha1.Resource("actionset"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("actionset"), name) } return obj.(*v1alpha1.ActionSet), nil } diff --git a/pkg/client/listers/cr/v1alpha1/blueprint.go b/pkg/client/listers/cr/v1alpha1/blueprint.go index e876ffa819..01c14fe797 100644 --- a/pkg/client/listers/cr/v1alpha1/blueprint.go +++ b/pkg/client/listers/cr/v1alpha1/blueprint.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,17 +13,15 @@ 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 ( - apierrors "k8s.io/apimachinery/pkg/api/errors" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // BlueprintLister helps list Blueprints. @@ -94,7 +92,7 @@ func (s blueprintNamespaceLister) Get(name string) (*v1alpha1.Blueprint, error) return nil, err } if !exists { - return nil, apierrors.NewNotFound(v1alpha1.Resource("blueprint"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("blueprint"), name) } return obj.(*v1alpha1.Blueprint), nil } diff --git a/pkg/client/listers/cr/v1alpha1/expansion_generated.go b/pkg/client/listers/cr/v1alpha1/expansion_generated.go index 4d01a6002d..cd33bf43ae 100644 --- a/pkg/client/listers/cr/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/cr/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ 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 diff --git a/pkg/client/listers/cr/v1alpha1/profile.go b/pkg/client/listers/cr/v1alpha1/profile.go index 95a9c78d0f..a2efa08cc6 100644 --- a/pkg/client/listers/cr/v1alpha1/profile.go +++ b/pkg/client/listers/cr/v1alpha1/profile.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,17 +13,15 @@ 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 ( - apierrors "k8s.io/apimachinery/pkg/api/errors" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // ProfileLister helps list Profiles. @@ -94,7 +92,7 @@ func (s profileNamespaceLister) Get(name string) (*v1alpha1.Profile, error) { return nil, err } if !exists { - return nil, apierrors.NewNotFound(v1alpha1.Resource("profile"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("profile"), name) } return obj.(*v1alpha1.Profile), nil } diff --git a/pkg/client/listers/cr/v1alpha1/repositoryserver.go b/pkg/client/listers/cr/v1alpha1/repositoryserver.go index ce6feeb579..8545b73450 100644 --- a/pkg/client/listers/cr/v1alpha1/repositoryserver.go +++ b/pkg/client/listers/cr/v1alpha1/repositoryserver.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kanister Authors. +Copyright 2024 The Kanister Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,17 +13,15 @@ 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 ( - apierrors "k8s.io/apimachinery/pkg/api/errors" + v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" ) // RepositoryServerLister helps list RepositoryServers. @@ -94,7 +92,7 @@ func (s repositoryServerNamespaceLister) Get(name string) (*v1alpha1.RepositoryS return nil, err } if !exists { - return nil, apierrors.NewNotFound(v1alpha1.Resource("repositoryserver"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("repositoryserver"), name) } return obj.(*v1alpha1.RepositoryServer), nil } diff --git a/pkg/controllers/repositoryserver/handler.go b/pkg/controllers/repositoryserver/handler.go index 597fccbe3f..29677628de 100644 --- a/pkg/controllers/repositoryserver/handler.go +++ b/pkg/controllers/repositoryserver/handler.go @@ -32,10 +32,9 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" "github.com/kanisterio/kanister/pkg/consts" "github.com/kanisterio/kanister/pkg/kopia/command/storage" - - crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" "github.com/kanisterio/kanister/pkg/kube" "github.com/kanisterio/kanister/pkg/poll" ) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 56533615bf..ca60f19a24 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -20,6 +20,8 @@ import ( "net/http" "github.com/go-logr/logr" + "github.com/pkg/errors" + "github.com/prometheus/client_golang/prometheus/promhttp" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -27,9 +29,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/kanisterio/kanister/pkg/validatingwebhook" "github.com/kanisterio/kanister/pkg/version" ) diff --git a/pkg/kopia/cli/internal/args/args.go b/pkg/kopia/cli/internal/args/args.go index bf6606334b..cad732dc9d 100644 --- a/pkg/kopia/cli/internal/args/args.go +++ b/pkg/kopia/cli/internal/args/args.go @@ -15,9 +15,9 @@ package args import ( - "github.com/kanisterio/kanister/pkg/kopia/cli" - "github.com/kanisterio/safecli/command" + + "github.com/kanisterio/kanister/pkg/kopia/cli" ) // ID creates a new ID argument. diff --git a/pkg/kopia/cli/internal/opts/cache_opts.go b/pkg/kopia/cli/internal/opts/cache_opts.go index 2c3343518a..fb1222b4af 100644 --- a/pkg/kopia/cli/internal/opts/cache_opts.go +++ b/pkg/kopia/cli/internal/opts/cache_opts.go @@ -17,9 +17,9 @@ package opts import ( "strconv" - "github.com/kanisterio/kanister/pkg/kopia/cli/args" - "github.com/kanisterio/safecli/command" + + "github.com/kanisterio/kanister/pkg/kopia/cli/args" ) const ( diff --git a/pkg/kopia/command/storage/secret_utils.go b/pkg/kopia/command/storage/secret_utils.go index e430dab553..4857b70e74 100644 --- a/pkg/kopia/command/storage/secret_utils.go +++ b/pkg/kopia/command/storage/secret_utils.go @@ -18,9 +18,8 @@ import ( "context" "time" - corev1 "k8s.io/api/core/v1" - "github.com/kanisterio/errkit" + corev1 "k8s.io/api/core/v1" crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" "github.com/kanisterio/kanister/pkg/aws"