Use controller-gen and code-generator latest version (#3133)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2025-01-06 23:27:26 +05:30
committed by GitHub
parent 96b07bf9a8
commit 54b67b5171
64 changed files with 1782 additions and 2205 deletions
@@ -19,17 +19,17 @@ limitations under the License.
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// FunctionApplyConfiguration represents a declarative configuration of the Function type for use
// with apply.
type FunctionApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *FunctionSpecApplyConfiguration `json:"spec,omitempty"`
metav1.TypeMetaApplyConfiguration `json:",inline"`
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *FunctionSpecApplyConfiguration `json:"spec,omitempty"`
}
// Function constructs a declarative configuration of the Function type for use with
@@ -47,7 +47,7 @@ func Function(name, namespace string) *FunctionApplyConfiguration {
// 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 *FunctionApplyConfiguration) WithKind(value string) *FunctionApplyConfiguration {
b.Kind = &value
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
@@ -55,7 +55,7 @@ func (b *FunctionApplyConfiguration) WithKind(value string) *FunctionApplyConfig
// 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 *FunctionApplyConfiguration) WithAPIVersion(value string) *FunctionApplyConfiguration {
b.APIVersion = &value
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
@@ -64,7 +64,7 @@ func (b *FunctionApplyConfiguration) WithAPIVersion(value string) *FunctionApply
// If called multiple times, the Name field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithName(value string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
@@ -73,7 +73,7 @@ func (b *FunctionApplyConfiguration) WithName(value string) *FunctionApplyConfig
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithGenerateName(value string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
@@ -82,7 +82,7 @@ func (b *FunctionApplyConfiguration) WithGenerateName(value string) *FunctionApp
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithNamespace(value string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
@@ -91,7 +91,7 @@ func (b *FunctionApplyConfiguration) WithNamespace(value string) *FunctionApplyC
// If called multiple times, the UID field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithUID(value types.UID) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
@@ -100,7 +100,7 @@ func (b *FunctionApplyConfiguration) WithUID(value types.UID) *FunctionApplyConf
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithResourceVersion(value string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
@@ -109,25 +109,25 @@ func (b *FunctionApplyConfiguration) WithResourceVersion(value string) *Function
// If called multiple times, the Generation field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithGeneration(value int64) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Generation = &value
b.ObjectMetaApplyConfiguration.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 *FunctionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FunctionApplyConfiguration {
func (b *FunctionApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.CreationTimestamp = &value
b.ObjectMetaApplyConfiguration.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 *FunctionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FunctionApplyConfiguration {
func (b *FunctionApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
@@ -136,7 +136,7 @@ func (b *FunctionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *F
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *FunctionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
@@ -146,11 +146,11 @@ func (b *FunctionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64)
// overwriting an existing map entries in Labels field with the same key.
func (b *FunctionApplyConfiguration) WithLabels(entries map[string]string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
@@ -161,11 +161,11 @@ func (b *FunctionApplyConfiguration) WithLabels(entries map[string]string) *Func
// overwriting an existing map entries in Annotations field with the same key.
func (b *FunctionApplyConfiguration) WithAnnotations(entries map[string]string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Annotations[k] = v
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
@@ -173,13 +173,13 @@ func (b *FunctionApplyConfiguration) WithAnnotations(entries map[string]string)
// 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 *FunctionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FunctionApplyConfiguration {
func (b *FunctionApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.OwnerReferences = append(b.OwnerReferences, *values[i])
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
@@ -190,14 +190,14 @@ func (b *FunctionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRefe
func (b *FunctionApplyConfiguration) WithFinalizers(values ...string) *FunctionApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *FunctionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
@@ -212,5 +212,5 @@ func (b *FunctionApplyConfiguration) WithSpec(value *FunctionSpecApplyConfigurat
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *FunctionApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
return b.ObjectMetaApplyConfiguration.Name
}