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"
)
// PackageApplyConfiguration represents a declarative configuration of the Package type for use
// with apply.
type PackageApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *PackageSpecApplyConfiguration `json:"spec,omitempty"`
Status *PackageStatusApplyConfiguration `json:"status,omitempty"`
metav1.TypeMetaApplyConfiguration `json:",inline"`
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *PackageSpecApplyConfiguration `json:"spec,omitempty"`
Status *PackageStatusApplyConfiguration `json:"status,omitempty"`
}
// Package constructs a declarative configuration of the Package type for use with
@@ -48,7 +48,7 @@ func Package(name, namespace string) *PackageApplyConfiguration {
// 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 *PackageApplyConfiguration) WithKind(value string) *PackageApplyConfiguration {
b.Kind = &value
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
@@ -56,7 +56,7 @@ func (b *PackageApplyConfiguration) WithKind(value string) *PackageApplyConfigur
// 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 *PackageApplyConfiguration) WithAPIVersion(value string) *PackageApplyConfiguration {
b.APIVersion = &value
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
@@ -65,7 +65,7 @@ func (b *PackageApplyConfiguration) WithAPIVersion(value string) *PackageApplyCo
// If called multiple times, the Name field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithName(value string) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Name = &value
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
@@ -74,7 +74,7 @@ func (b *PackageApplyConfiguration) WithName(value string) *PackageApplyConfigur
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithGenerateName(value string) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.GenerateName = &value
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
@@ -83,7 +83,7 @@ func (b *PackageApplyConfiguration) WithGenerateName(value string) *PackageApply
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithNamespace(value string) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
@@ -92,7 +92,7 @@ func (b *PackageApplyConfiguration) WithNamespace(value string) *PackageApplyCon
// If called multiple times, the UID field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithUID(value types.UID) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.UID = &value
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
@@ -101,7 +101,7 @@ func (b *PackageApplyConfiguration) WithUID(value types.UID) *PackageApplyConfig
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithResourceVersion(value string) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ResourceVersion = &value
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
@@ -110,25 +110,25 @@ func (b *PackageApplyConfiguration) WithResourceVersion(value string) *PackageAp
// If called multiple times, the Generation field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithGeneration(value int64) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PackageApplyConfiguration {
func (b *PackageApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PackageApplyConfiguration {
func (b *PackageApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionTimestamp = &value
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
@@ -137,7 +137,7 @@ func (b *PackageApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *Pa
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *PackageApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PackageApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.DeletionGracePeriodSeconds = &value
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
@@ -147,11 +147,11 @@ func (b *PackageApplyConfiguration) WithDeletionGracePeriodSeconds(value int64)
// overwriting an existing map entries in Labels field with the same key.
func (b *PackageApplyConfiguration) WithLabels(entries map[string]string) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) WithLabels(entries map[string]string) *Packa
// overwriting an existing map entries in Annotations field with the same key.
func (b *PackageApplyConfiguration) WithAnnotations(entries map[string]string) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) 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 *PackageApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PackageApplyConfiguration {
func (b *PackageApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRefer
func (b *PackageApplyConfiguration) WithFinalizers(values ...string) *PackageApplyConfiguration {
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 *PackageApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{}
}
}
@@ -221,5 +221,5 @@ func (b *PackageApplyConfiguration) WithStatus(value *PackageStatusApplyConfigur
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *PackageApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
return b.ObjectMetaApplyConfiguration.Name
}