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,18 +19,18 @@ 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"
)
// CanaryConfigApplyConfiguration represents a declarative configuration of the CanaryConfig type for use
// with apply.
type CanaryConfigApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *CanaryConfigSpecApplyConfiguration `json:"spec,omitempty"`
Status *CanaryConfigStatusApplyConfiguration `json:"status,omitempty"`
metav1.TypeMetaApplyConfiguration `json:",inline"`
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *CanaryConfigSpecApplyConfiguration `json:"spec,omitempty"`
Status *CanaryConfigStatusApplyConfiguration `json:"status,omitempty"`
}
// CanaryConfig constructs a declarative configuration of the CanaryConfig type for use with
@@ -48,7 +48,7 @@ func CanaryConfig(name, namespace string) *CanaryConfigApplyConfiguration {
// 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 *CanaryConfigApplyConfiguration) WithKind(value string) *CanaryConfigApplyConfiguration {
b.Kind = &value
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
@@ -56,7 +56,7 @@ func (b *CanaryConfigApplyConfiguration) WithKind(value string) *CanaryConfigApp
// 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 *CanaryConfigApplyConfiguration) WithAPIVersion(value string) *CanaryConfigApplyConfiguration {
b.APIVersion = &value
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
@@ -65,7 +65,7 @@ func (b *CanaryConfigApplyConfiguration) WithAPIVersion(value string) *CanaryCon
// If called multiple times, the Name field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithName(value string) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
@@ -74,7 +74,7 @@ func (b *CanaryConfigApplyConfiguration) WithName(value string) *CanaryConfigApp
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithGenerateName(value string) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
@@ -83,7 +83,7 @@ func (b *CanaryConfigApplyConfiguration) WithGenerateName(value string) *CanaryC
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithNamespace(value string) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
@@ -92,7 +92,7 @@ func (b *CanaryConfigApplyConfiguration) WithNamespace(value string) *CanaryConf
// If called multiple times, the UID field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithUID(value types.UID) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
@@ -101,7 +101,7 @@ func (b *CanaryConfigApplyConfiguration) WithUID(value types.UID) *CanaryConfigA
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithResourceVersion(value string) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
@@ -110,25 +110,25 @@ func (b *CanaryConfigApplyConfiguration) WithResourceVersion(value string) *Cana
// If called multiple times, the Generation field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithGeneration(value int64) *CanaryConfigApplyConfiguration {
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 *CanaryConfigApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CanaryConfigApplyConfiguration {
func (b *CanaryConfigApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *CanaryConfigApplyConfiguration {
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 *CanaryConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CanaryConfigApplyConfiguration {
func (b *CanaryConfigApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
@@ -137,7 +137,7 @@ func (b *CanaryConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *CanaryConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CanaryConfigApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
@@ -147,11 +147,11 @@ func (b *CanaryConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value in
// overwriting an existing map entries in Labels field with the same key.
func (b *CanaryConfigApplyConfiguration) WithLabels(entries map[string]string) *CanaryConfigApplyConfiguration {
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
}
@@ -162,11 +162,11 @@ func (b *CanaryConfigApplyConfiguration) WithLabels(entries map[string]string) *
// overwriting an existing map entries in Annotations field with the same key.
func (b *CanaryConfigApplyConfiguration) WithAnnotations(entries map[string]string) *CanaryConfigApplyConfiguration {
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
}
@@ -174,13 +174,13 @@ func (b *CanaryConfigApplyConfiguration) WithAnnotations(entries map[string]stri
// 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 *CanaryConfigApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CanaryConfigApplyConfiguration {
func (b *CanaryConfigApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *CanaryConfigApplyConfiguration {
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
}
@@ -191,14 +191,14 @@ func (b *CanaryConfigApplyConfiguration) WithOwnerReferences(values ...*v1.Owner
func (b *CanaryConfigApplyConfiguration) WithFinalizers(values ...string) *CanaryConfigApplyConfiguration {
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 *CanaryConfigApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
@@ -221,5 +221,5 @@ func (b *CanaryConfigApplyConfiguration) WithStatus(value *CanaryConfigStatusApp
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *CanaryConfigApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
return b.ObjectMetaApplyConfiguration.Name
}