diff --git a/config/applyconfigurations/config/v1/baremetalplatformstatus.go b/config/applyconfigurations/config/v1/baremetalplatformstatus.go index 1f6dd6df6b..f90232bff9 100644 --- a/config/applyconfigurations/config/v1/baremetalplatformstatus.go +++ b/config/applyconfigurations/config/v1/baremetalplatformstatus.go @@ -45,6 +45,17 @@ type BareMetalPlatformStatusApplyConfiguration struct { NodeDNSIP *string `json:"nodeDNSIP,omitempty"` // loadBalancer defines how the load balancer used by the cluster is configured. LoadBalancer *BareMetalPlatformLoadBalancerApplyConfiguration `json:"loadBalancer,omitempty"` + // vipManagement indicates which VIP management mechanism is active + // on this cluster. + // Allowed values are `Keepalived`, `BGP`, and omitted. + // Once set to a non-empty value, this field is immutable. + // When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are + // deployed as static pods to advertise VIPs via BGP, replacing the + // default keepalived/VRRP mechanism. + // When set to `Keepalived`, the default keepalived-based VIP + // management is used. + // When omitted, the default keepalived-based VIP management is used. + VIPManagement *configv1.VIPManagementType `json:"vipManagement,omitempty"` // dnsRecordsType determines whether records for api, api-int, and ingress // are provided by the internal DNS service or externally. // Allowed values are `Internal`, `External`, and omitted. @@ -120,6 +131,14 @@ func (b *BareMetalPlatformStatusApplyConfiguration) WithLoadBalancer(value *Bare return b } +// WithVIPManagement sets the VIPManagement 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 VIPManagement field is set to the value of the last call. +func (b *BareMetalPlatformStatusApplyConfiguration) WithVIPManagement(value configv1.VIPManagementType) *BareMetalPlatformStatusApplyConfiguration { + b.VIPManagement = &value + return b +} + // WithDNSRecordsType sets the DNSRecordsType 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 DNSRecordsType field is set to the value of the last call. diff --git a/config/applyconfigurations/config/v1alpha1/backupspec.go b/config/applyconfigurations/config/v1alpha1/backupspec.go deleted file mode 100644 index 01ff3f7dc8..0000000000 --- a/config/applyconfigurations/config/v1alpha1/backupspec.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// BackupSpecApplyConfiguration represents a declarative configuration of the BackupSpec type for use -// with apply. -type BackupSpecApplyConfiguration struct { - // etcd specifies the configuration for periodic backups of the etcd cluster - EtcdBackupSpec *EtcdBackupSpecApplyConfiguration `json:"etcd,omitempty"` -} - -// BackupSpecApplyConfiguration constructs a declarative configuration of the BackupSpec type for use with -// apply. -func BackupSpec() *BackupSpecApplyConfiguration { - return &BackupSpecApplyConfiguration{} -} - -// WithEtcdBackupSpec sets the EtcdBackupSpec 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 EtcdBackupSpec field is set to the value of the last call. -func (b *BackupSpecApplyConfiguration) WithEtcdBackupSpec(value *EtcdBackupSpecApplyConfiguration) *BackupSpecApplyConfiguration { - b.EtcdBackupSpec = value - return b -} diff --git a/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go b/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go deleted file mode 100644 index edef778d81..0000000000 --- a/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// EtcdBackupSpecApplyConfiguration represents a declarative configuration of the EtcdBackupSpec type for use -// with apply. -// -// EtcdBackupSpec provides configuration for automated etcd backups to the cluster-etcd-operator -type EtcdBackupSpecApplyConfiguration struct { - // schedule defines the recurring backup schedule in Cron format - // every 2 hours: 0 */2 * * * - // every day at 3am: 0 3 * * * - // Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. - // The current default is "no backups", but will change in the future. - Schedule *string `json:"schedule,omitempty"` - // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. - // If not specified, this will default to the time zone of the kube-controller-manager process. - // See https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones - TimeZone *string `json:"timeZone,omitempty"` - // retentionPolicy defines the retention policy for retaining and deleting existing backups. - RetentionPolicy *RetentionPolicyApplyConfiguration `json:"retentionPolicy,omitempty"` - // pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the - // etcd backup files would be saved - // The PVC itself must always be created in the "openshift-etcd" namespace - // If the PVC is left unspecified "" then the platform will choose a reasonable default location to save the backup. - // In the future this would be backups saved across the control-plane master nodes. - PVCName *string `json:"pvcName,omitempty"` -} - -// EtcdBackupSpecApplyConfiguration constructs a declarative configuration of the EtcdBackupSpec type for use with -// apply. -func EtcdBackupSpec() *EtcdBackupSpecApplyConfiguration { - return &EtcdBackupSpecApplyConfiguration{} -} - -// WithSchedule sets the Schedule 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 Schedule field is set to the value of the last call. -func (b *EtcdBackupSpecApplyConfiguration) WithSchedule(value string) *EtcdBackupSpecApplyConfiguration { - b.Schedule = &value - return b -} - -// WithTimeZone sets the TimeZone 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 TimeZone field is set to the value of the last call. -func (b *EtcdBackupSpecApplyConfiguration) WithTimeZone(value string) *EtcdBackupSpecApplyConfiguration { - b.TimeZone = &value - return b -} - -// WithRetentionPolicy sets the RetentionPolicy 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 RetentionPolicy field is set to the value of the last call. -func (b *EtcdBackupSpecApplyConfiguration) WithRetentionPolicy(value *RetentionPolicyApplyConfiguration) *EtcdBackupSpecApplyConfiguration { - b.RetentionPolicy = value - return b -} - -// WithPVCName sets the PVCName 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 PVCName field is set to the value of the last call. -func (b *EtcdBackupSpecApplyConfiguration) WithPVCName(value string) *EtcdBackupSpecApplyConfiguration { - b.PVCName = &value - return b -} diff --git a/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go b/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go deleted file mode 100644 index 9e3994eb90..0000000000 --- a/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// RetentionNumberConfigApplyConfiguration represents a declarative configuration of the RetentionNumberConfig type for use -// with apply. -// -// RetentionNumberConfig specifies the configuration of the retention policy on the number of backups -type RetentionNumberConfigApplyConfiguration struct { - // maxNumberOfBackups defines the maximum number of backups to retain. - // If the existing number of backups saved is equal to MaxNumberOfBackups then - // the oldest backup will be removed before a new backup is initiated. - MaxNumberOfBackups *int `json:"maxNumberOfBackups,omitempty"` -} - -// RetentionNumberConfigApplyConfiguration constructs a declarative configuration of the RetentionNumberConfig type for use with -// apply. -func RetentionNumberConfig() *RetentionNumberConfigApplyConfiguration { - return &RetentionNumberConfigApplyConfiguration{} -} - -// WithMaxNumberOfBackups sets the MaxNumberOfBackups 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 MaxNumberOfBackups field is set to the value of the last call. -func (b *RetentionNumberConfigApplyConfiguration) WithMaxNumberOfBackups(value int) *RetentionNumberConfigApplyConfiguration { - b.MaxNumberOfBackups = &value - return b -} diff --git a/config/applyconfigurations/config/v1alpha1/retentionpolicy.go b/config/applyconfigurations/config/v1alpha1/retentionpolicy.go deleted file mode 100644 index c653590aac..0000000000 --- a/config/applyconfigurations/config/v1alpha1/retentionpolicy.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" -) - -// RetentionPolicyApplyConfiguration represents a declarative configuration of the RetentionPolicy type for use -// with apply. -// -// RetentionPolicy defines the retention policy for retaining and deleting existing backups. -// This struct is a discriminated union that allows users to select the type of retention policy from the supported types. -type RetentionPolicyApplyConfiguration struct { - // retentionType sets the type of retention policy. - // Currently, the only valid policies are retention by number of backups (RetentionNumber), by the size of backups (RetentionSize). More policies or types may be added in the future. - // Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. - // The current default is RetentionNumber with 15 backups kept. - RetentionType *configv1alpha1.RetentionType `json:"retentionType,omitempty"` - // retentionNumber configures the retention policy based on the number of backups - RetentionNumber *RetentionNumberConfigApplyConfiguration `json:"retentionNumber,omitempty"` - // retentionSize configures the retention policy based on the size of backups - RetentionSize *RetentionSizeConfigApplyConfiguration `json:"retentionSize,omitempty"` -} - -// RetentionPolicyApplyConfiguration constructs a declarative configuration of the RetentionPolicy type for use with -// apply. -func RetentionPolicy() *RetentionPolicyApplyConfiguration { - return &RetentionPolicyApplyConfiguration{} -} - -// WithRetentionType sets the RetentionType 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 RetentionType field is set to the value of the last call. -func (b *RetentionPolicyApplyConfiguration) WithRetentionType(value configv1alpha1.RetentionType) *RetentionPolicyApplyConfiguration { - b.RetentionType = &value - return b -} - -// WithRetentionNumber sets the RetentionNumber 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 RetentionNumber field is set to the value of the last call. -func (b *RetentionPolicyApplyConfiguration) WithRetentionNumber(value *RetentionNumberConfigApplyConfiguration) *RetentionPolicyApplyConfiguration { - b.RetentionNumber = value - return b -} - -// WithRetentionSize sets the RetentionSize 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 RetentionSize field is set to the value of the last call. -func (b *RetentionPolicyApplyConfiguration) WithRetentionSize(value *RetentionSizeConfigApplyConfiguration) *RetentionPolicyApplyConfiguration { - b.RetentionSize = value - return b -} diff --git a/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go b/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go deleted file mode 100644 index 45b2eb8ae6..0000000000 --- a/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// RetentionSizeConfigApplyConfiguration represents a declarative configuration of the RetentionSizeConfig type for use -// with apply. -// -// RetentionSizeConfig specifies the configuration of the retention policy on the total size of backups -type RetentionSizeConfigApplyConfiguration struct { - // maxSizeOfBackupsGb defines the total size in GB of backups to retain. - // If the current total size backups exceeds MaxSizeOfBackupsGb then - // the oldest backup will be removed before a new backup is initiated. - MaxSizeOfBackupsGb *int `json:"maxSizeOfBackupsGb,omitempty"` -} - -// RetentionSizeConfigApplyConfiguration constructs a declarative configuration of the RetentionSizeConfig type for use with -// apply. -func RetentionSizeConfig() *RetentionSizeConfigApplyConfiguration { - return &RetentionSizeConfigApplyConfiguration{} -} - -// WithMaxSizeOfBackupsGb sets the MaxSizeOfBackupsGb 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 MaxSizeOfBackupsGb field is set to the value of the last call. -func (b *RetentionSizeConfigApplyConfiguration) WithMaxSizeOfBackupsGb(value int) *RetentionSizeConfigApplyConfiguration { - b.MaxSizeOfBackupsGb = &value - return b -} diff --git a/config/applyconfigurations/internal/internal.go b/config/applyconfigurations/internal/internal.go index 15df23abdc..f3a7a41a47 100644 --- a/config/applyconfigurations/internal/internal.go +++ b/config/applyconfigurations/internal/internal.go @@ -462,6 +462,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeDNSIP type: scalar: string + - name: vipManagement + type: + scalar: string - name: com.github.openshift.api.config.v1.BasicAuthIdentityProvider map: fields: @@ -4485,46 +4488,6 @@ var schemaYAML = typed.YAMLObject(`types: fields: - fieldName: bearerToken discriminatorValue: BearerToken -- name: com.github.openshift.api.config.v1alpha1.Backup - map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: com.github.openshift.api.config.v1alpha1.BackupSpec - default: {} - - name: status - type: - namedType: com.github.openshift.api.config.v1alpha1.BackupStatus - default: {} -- name: com.github.openshift.api.config.v1alpha1.BackupSpec - map: - fields: - - name: etcd - type: - namedType: com.github.openshift.api.config.v1alpha1.EtcdBackupSpec - default: {} -- name: com.github.openshift.api.config.v1alpha1.BackupStatus - map: - elementType: - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable - name: com.github.openshift.api.config.v1alpha1.BasicAuth map: fields: @@ -4717,25 +4680,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: curve type: scalar: string -- name: com.github.openshift.api.config.v1alpha1.EtcdBackupSpec - map: - fields: - - name: pvcName - type: - scalar: string - default: "" - - name: retentionPolicy - type: - namedType: com.github.openshift.api.config.v1alpha1.RetentionPolicy - default: {} - - name: schedule - type: - scalar: string - default: "" - - name: timeZone - type: - scalar: string - default: "" - name: com.github.openshift.api.config.v1alpha1.GatherConfig map: fields: @@ -5622,40 +5566,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: size type: scalar: string -- name: com.github.openshift.api.config.v1alpha1.RetentionNumberConfig - map: - fields: - - name: maxNumberOfBackups - type: - scalar: numeric - default: 0 -- name: com.github.openshift.api.config.v1alpha1.RetentionPolicy - map: - fields: - - name: retentionNumber - type: - namedType: com.github.openshift.api.config.v1alpha1.RetentionNumberConfig - - name: retentionSize - type: - namedType: com.github.openshift.api.config.v1alpha1.RetentionSizeConfig - - name: retentionType - type: - scalar: string - default: "" - unions: - - discriminator: retentionType - fields: - - fieldName: retentionNumber - discriminatorValue: RetentionNumber - - fieldName: retentionSize - discriminatorValue: RetentionSize -- name: com.github.openshift.api.config.v1alpha1.RetentionSizeConfig - map: - fields: - - name: maxSizeOfBackupsGb - type: - scalar: numeric - default: 0 - name: com.github.openshift.api.config.v1alpha1.SecretKeySelector map: fields: diff --git a/config/applyconfigurations/utils.go b/config/applyconfigurations/utils.go index e849c0e45c..1b7cc03c87 100644 --- a/config/applyconfigurations/utils.go +++ b/config/applyconfigurations/utils.go @@ -524,10 +524,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1alpha1.AuditApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("AuthorizationConfig"): return &configv1alpha1.AuthorizationConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Backup"): - return &configv1alpha1.BackupApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("BackupSpec"): - return &configv1alpha1.BackupSpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("BasicAuth"): return &configv1alpha1.BasicAuthApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CertificateConfig"): @@ -552,8 +548,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1alpha1.DropEqualActionConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ECDSAKeyConfig"): return &configv1alpha1.ECDSAKeyConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupSpec"): - return &configv1alpha1.EtcdBackupSpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("GatherConfig"): return &configv1alpha1.GatherConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("HashModActionConfig"): @@ -654,12 +648,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1alpha1.ReplaceActionConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Retention"): return &configv1alpha1.RetentionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("RetentionNumberConfig"): - return &configv1alpha1.RetentionNumberConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("RetentionPolicy"): - return &configv1alpha1.RetentionPolicyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("RetentionSizeConfig"): - return &configv1alpha1.RetentionSizeConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("RSAKeyConfig"): return &configv1alpha1.RSAKeyConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("SecretKeySelector"): diff --git a/config/clientset/versioned/typed/config/v1alpha1/backup.go b/config/clientset/versioned/typed/config/v1alpha1/backup.go deleted file mode 100644 index 89c7b176e0..0000000000 --- a/config/clientset/versioned/typed/config/v1alpha1/backup.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - context "context" - - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - applyconfigurationsconfigv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1" - scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" -) - -// BackupsGetter has a method to return a BackupInterface. -// A group's client should implement this interface. -type BackupsGetter interface { - Backups() BackupInterface -} - -// BackupInterface has methods to work with Backup resources. -type BackupInterface interface { - Create(ctx context.Context, backup *configv1alpha1.Backup, opts v1.CreateOptions) (*configv1alpha1.Backup, error) - Update(ctx context.Context, backup *configv1alpha1.Backup, opts v1.UpdateOptions) (*configv1alpha1.Backup, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, backup *configv1alpha1.Backup, opts v1.UpdateOptions) (*configv1alpha1.Backup, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*configv1alpha1.Backup, error) - List(ctx context.Context, opts v1.ListOptions) (*configv1alpha1.BackupList, 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 *configv1alpha1.Backup, err error) - Apply(ctx context.Context, backup *applyconfigurationsconfigv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *configv1alpha1.Backup, err error) - // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, backup *applyconfigurationsconfigv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *configv1alpha1.Backup, err error) - BackupExpansion -} - -// backups implements BackupInterface -type backups struct { - *gentype.ClientWithListAndApply[*configv1alpha1.Backup, *configv1alpha1.BackupList, *applyconfigurationsconfigv1alpha1.BackupApplyConfiguration] -} - -// newBackups returns a Backups -func newBackups(c *ConfigV1alpha1Client) *backups { - return &backups{ - gentype.NewClientWithListAndApply[*configv1alpha1.Backup, *configv1alpha1.BackupList, *applyconfigurationsconfigv1alpha1.BackupApplyConfiguration]( - "backups", - c.RESTClient(), - scheme.ParameterCodec, - "", - func() *configv1alpha1.Backup { return &configv1alpha1.Backup{} }, - func() *configv1alpha1.BackupList { return &configv1alpha1.BackupList{} }, - ), - } -} diff --git a/config/clientset/versioned/typed/config/v1alpha1/config_client.go b/config/clientset/versioned/typed/config/v1alpha1/config_client.go index 23ba9a19c0..6edf1c0661 100644 --- a/config/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/config/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -12,7 +12,6 @@ import ( type ConfigV1alpha1Interface interface { RESTClient() rest.Interface - BackupsGetter CRIOCredentialProviderConfigsGetter ClusterMonitoringsGetter InsightsDataGathersGetter @@ -24,10 +23,6 @@ type ConfigV1alpha1Client struct { restClient rest.Interface } -func (c *ConfigV1alpha1Client) Backups() BackupInterface { - return newBackups(c) -} - func (c *ConfigV1alpha1Client) CRIOCredentialProviderConfigs() CRIOCredentialProviderConfigInterface { return newCRIOCredentialProviderConfigs(c) } diff --git a/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go b/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go deleted file mode 100644 index 91db422ac3..0000000000 --- a/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "github.com/openshift/api/config/v1alpha1" - configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1" - typedconfigv1alpha1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1" - gentype "k8s.io/client-go/gentype" -) - -// fakeBackups implements BackupInterface -type fakeBackups struct { - *gentype.FakeClientWithListAndApply[*v1alpha1.Backup, *v1alpha1.BackupList, *configv1alpha1.BackupApplyConfiguration] - Fake *FakeConfigV1alpha1 -} - -func newFakeBackups(fake *FakeConfigV1alpha1) typedconfigv1alpha1.BackupInterface { - return &fakeBackups{ - gentype.NewFakeClientWithListAndApply[*v1alpha1.Backup, *v1alpha1.BackupList, *configv1alpha1.BackupApplyConfiguration]( - fake.Fake, - "", - v1alpha1.SchemeGroupVersion.WithResource("backups"), - v1alpha1.SchemeGroupVersion.WithKind("Backup"), - func() *v1alpha1.Backup { return &v1alpha1.Backup{} }, - func() *v1alpha1.BackupList { return &v1alpha1.BackupList{} }, - func(dst, src *v1alpha1.BackupList) { dst.ListMeta = src.ListMeta }, - func(list *v1alpha1.BackupList) []*v1alpha1.Backup { return gentype.ToPointerSlice(list.Items) }, - func(list *v1alpha1.BackupList, items []*v1alpha1.Backup) { - list.Items = gentype.FromPointerSlice(items) - }, - ), - fake, - } -} diff --git a/config/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go b/config/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go index 381179df9c..7c2611082b 100644 --- a/config/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go +++ b/config/clientset/versioned/typed/config/v1alpha1/fake/fake_config_client.go @@ -12,10 +12,6 @@ type FakeConfigV1alpha1 struct { *testing.Fake } -func (c *FakeConfigV1alpha1) Backups() v1alpha1.BackupInterface { - return newFakeBackups(c) -} - func (c *FakeConfigV1alpha1) CRIOCredentialProviderConfigs() v1alpha1.CRIOCredentialProviderConfigInterface { return newFakeCRIOCredentialProviderConfigs(c) } diff --git a/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go b/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go index bc1f603194..8edd80078d 100644 --- a/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go +++ b/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go @@ -2,8 +2,6 @@ package v1alpha1 -type BackupExpansion interface{} - type CRIOCredentialProviderConfigExpansion interface{} type ClusterMonitoringExpansion interface{} diff --git a/config/informers/externalversions/config/v1alpha1/backup.go b/config/informers/externalversions/config/v1alpha1/backup.go deleted file mode 100644 index e3ddf964a3..0000000000 --- a/config/informers/externalversions/config/v1alpha1/backup.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - context "context" - time "time" - - apiconfigv1alpha1 "github.com/openshift/api/config/v1alpha1" - versioned "github.com/openshift/client-go/config/clientset/versioned" - internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" - configv1alpha1 "github.com/openshift/client-go/config/listers/config/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// BackupInformer provides access to a shared informer and lister for -// Backups. -type BackupInformer interface { - Informer() cache.SharedIndexInformer - Lister() configv1alpha1.BackupLister -} - -type backupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewBackupInformer constructs a new informer for Backup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBackupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewBackupInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) -} - -// NewFilteredBackupInformer constructs a new informer for Backup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBackupInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewBackupInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) -} - -// NewBackupInformerWithOptions constructs a new informer for Backup type with additional options. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBackupInformerWithOptions(client versioned.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { - gvr := schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1alpha1", Resource: "backups"} - identifier := options.InformerName.WithResource(gvr) - tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( - cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ - ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.ConfigV1alpha1().Backups().List(context.Background(), opts) - }, - WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.ConfigV1alpha1().Backups().Watch(context.Background(), opts) - }, - ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.ConfigV1alpha1().Backups().List(ctx, opts) - }, - WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.ConfigV1alpha1().Backups().Watch(ctx, opts) - }, - }, client), - &apiconfigv1alpha1.Backup{}, - cache.SharedIndexInformerOptions{ - ResyncPeriod: options.ResyncPeriod, - Indexers: options.Indexers, - Identifier: identifier, - }, - ) -} - -func (f *backupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewBackupInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) -} - -func (f *backupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiconfigv1alpha1.Backup{}, f.defaultInformer) -} - -func (f *backupInformer) Lister() configv1alpha1.BackupLister { - return configv1alpha1.NewBackupLister(f.Informer().GetIndexer()) -} diff --git a/config/informers/externalversions/config/v1alpha1/interface.go b/config/informers/externalversions/config/v1alpha1/interface.go index 17b0ebcc0b..03693fcccb 100644 --- a/config/informers/externalversions/config/v1alpha1/interface.go +++ b/config/informers/externalversions/config/v1alpha1/interface.go @@ -8,8 +8,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // Backups returns a BackupInformer. - Backups() BackupInformer // CRIOCredentialProviderConfigs returns a CRIOCredentialProviderConfigInformer. CRIOCredentialProviderConfigs() CRIOCredentialProviderConfigInformer // ClusterMonitorings returns a ClusterMonitoringInformer. @@ -31,11 +29,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Backups returns a BackupInformer. -func (v *version) Backups() BackupInformer { - return &backupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // CRIOCredentialProviderConfigs returns a CRIOCredentialProviderConfigInformer. func (v *version) CRIOCredentialProviderConfigs() CRIOCredentialProviderConfigInformer { return &cRIOCredentialProviderConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/config/informers/externalversions/generic.go b/config/informers/externalversions/generic.go index fbc19aaefd..1bbf666684 100644 --- a/config/informers/externalversions/generic.go +++ b/config/informers/externalversions/generic.go @@ -91,8 +91,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Schedulers().Informer()}, nil // Group=config.openshift.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("backups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1alpha1().Backups().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("criocredentialproviderconfigs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1alpha1().CRIOCredentialProviderConfigs().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("clustermonitorings"): diff --git a/config/listers/config/v1alpha1/backup.go b/config/listers/config/v1alpha1/backup.go deleted file mode 100644 index 6b992e0d03..0000000000 --- a/config/listers/config/v1alpha1/backup.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - labels "k8s.io/apimachinery/pkg/labels" - listers "k8s.io/client-go/listers" - cache "k8s.io/client-go/tools/cache" -) - -// BackupLister helps list Backups. -// All objects returned here must be treated as read-only. -type BackupLister interface { - // List lists all Backups in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*configv1alpha1.Backup, err error) - // Get retrieves the Backup from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*configv1alpha1.Backup, error) - BackupListerExpansion -} - -// backupLister implements the BackupLister interface. -type backupLister struct { - listers.ResourceIndexer[*configv1alpha1.Backup] -} - -// NewBackupLister returns a new BackupLister. -func NewBackupLister(indexer cache.Indexer) BackupLister { - return &backupLister{listers.New[*configv1alpha1.Backup](indexer, configv1alpha1.Resource("backup"))} -} diff --git a/config/listers/config/v1alpha1/expansion_generated.go b/config/listers/config/v1alpha1/expansion_generated.go index 3baf74bc8b..e9e559762e 100644 --- a/config/listers/config/v1alpha1/expansion_generated.go +++ b/config/listers/config/v1alpha1/expansion_generated.go @@ -2,10 +2,6 @@ package v1alpha1 -// BackupListerExpansion allows custom methods to be added to -// BackupLister. -type BackupListerExpansion interface{} - // CRIOCredentialProviderConfigListerExpansion allows custom methods to be added to // CRIOCredentialProviderConfigLister. type CRIOCredentialProviderConfigListerExpansion interface{} diff --git a/go.mod b/go.mod index fea4d171fa..dd5c01cebf 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/openshift/client-go go 1.26.0 +replace github.com/openshift/api => github.com/bhperry/openshift-api v0.0.0-20260727162810-8887fbaa588a + require ( github.com/openshift/api v0.0.0-20260723163829-0f2bcae5eb15 github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee diff --git a/go.sum b/go.sum index 2e59dd3334..f1e94ebab2 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/bhperry/openshift-api v0.0.0-20260727162810-8887fbaa588a h1:by+AYJLV32uxdu2/MU9euR1RzCYUlQprnGwuOCMtzHU= +github.com/bhperry/openshift-api v0.0.0-20260727162810-8887fbaa588a/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -71,8 +73,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/openshift/api v0.0.0-20260723163829-0f2bcae5eb15 h1:HZaHnJJGR/nl8S962qxiy9D8I5wFehepJbk02FUs6ig= -github.com/openshift/api v0.0.0-20260723163829-0f2bcae5eb15/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4= github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/controllerconfigspec.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/controllerconfigspec.go index f67b3365ff..944100958c 100644 --- a/machineconfiguration/applyconfigurations/machineconfiguration/v1/controllerconfigspec.go +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/controllerconfigspec.go @@ -42,6 +42,14 @@ type ControllerConfigSpecApplyConfiguration struct { InternalRegistryPullSecret []byte `json:"internalRegistryPullSecret,omitempty"` // images is map of images that are used by the controller to render templates under ./templates/ Images map[string]string `json:"images,omitempty"` + // bgpVIPPeersJSON carries the BGP VIP peer configuration (the config.json + // payload of the bgp-vip-config ConfigMap) for rendering the frr-k8s + // static pod peer file on control plane nodes. Only set when BGP-based + // VIP management is enabled. + // When omitted, BGP-based VIP management is not configured and no + // frr-k8s peer file is rendered. + // When set, the value must be between 1 and 65536 characters long. + BGPVIPPeersJSON *string `json:"bgpVIPPeersJSON,omitempty"` // baseOSContainerImage is the new-format container image for operating system updates. BaseOSContainerImage *string `json:"baseOSContainerImage,omitempty"` // baseOSExtensionsContainerImage is the matching extensions container for the new-format container @@ -204,6 +212,14 @@ func (b *ControllerConfigSpecApplyConfiguration) WithImages(entries map[string]s return b } +// WithBGPVIPPeersJSON sets the BGPVIPPeersJSON 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 BGPVIPPeersJSON field is set to the value of the last call. +func (b *ControllerConfigSpecApplyConfiguration) WithBGPVIPPeersJSON(value string) *ControllerConfigSpecApplyConfiguration { + b.BGPVIPPeersJSON = &value + return b +} + // WithBaseOSContainerImage sets the BaseOSContainerImage 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 BaseOSContainerImage field is set to the value of the last call. diff --git a/operator/applyconfigurations/internal/internal.go b/operator/applyconfigurations/internal/internal.go index fac2f41a76..b24a1acab5 100644 --- a/operator/applyconfigurations/internal/internal.go +++ b/operator/applyconfigurations/internal/internal.go @@ -4277,17 +4277,6 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: com.github.openshift.api.operator.v1alpha1.BackupJobReference - map: - fields: - - name: name - type: - scalar: string - default: "" - - name: namespace - type: - scalar: string - default: "" - name: com.github.openshift.api.operator.v1alpha1.ClusterAPI map: fields: @@ -4458,19 +4447,116 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus default: {} -- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupJob map: fields: - - name: pvcName + - name: name type: scalar: string default: "" -- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus + - name: namespace + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicy map: fields: - - name: backupJob + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicySpec + default: {} + - name: status + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyStatus + default: {} +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyRetentionRule + map: + fields: + - name: maxQuantity + type: + scalar: numeric + default: 0 + - name: maxSize + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: maxQuantity + discriminatorValue: MaxQuantity + - fieldName: maxSize + discriminatorValue: MaxSize +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicySpec + map: + fields: + - name: nodeCount + type: + scalar: numeric + - name: nodeSelector + type: + map: + elementType: + scalar: string + - name: retentionRules + type: + list: + elementType: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyRetentionRule + elementRelationship: atomic + - name: schedule type: - namedType: com.github.openshift.api.operator.v1alpha1.BackupJobReference + scalar: string + default: "" + - name: storage + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage + default: {} + - name: timeZone + type: + scalar: string +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyStatus + map: + fields: + - name: lastScheduleNodes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: lastScheduleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec + map: + fields: + - name: nodeName + type: + scalar: string + - name: storage + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage + default: {} +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus + map: + fields: - name: conditions type: list: @@ -4479,6 +4565,56 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - type + - name: filePath + type: + scalar: string + - name: fileSize + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: job + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupJob + - name: nodeName + type: + scalar: string +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage + map: + fields: + - name: local + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStorageLocal + - name: pvc + type: + namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStoragePvc + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: local + discriminatorValue: Local + - fieldName: pvc + discriminatorValue: PVC +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStorageLocal + map: + fields: + - name: hostPath + type: + scalar: string + default: "" +- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStoragePvc + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: path + type: + scalar: string + default: "" - name: com.github.openshift.api.operator.v1alpha1.ImageContentSourcePolicy map: fields: @@ -4673,6 +4809,8 @@ var schemaYAML = typed.YAMLObject(`types: - name: value type: scalar: string +- name: io.k8s.apimachinery.pkg.api.resource.Quantity + scalar: untyped - name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition map: fields: diff --git a/operator/applyconfigurations/operator/v1alpha1/backupjobreference.go b/operator/applyconfigurations/operator/v1alpha1/backupjobreference.go deleted file mode 100644 index 85e4f5bd54..0000000000 --- a/operator/applyconfigurations/operator/v1alpha1/backupjobreference.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// BackupJobReferenceApplyConfiguration represents a declarative configuration of the BackupJobReference type for use -// with apply. -// -// BackupJobReference holds a reference to the batch/v1 Job created to run the etcd backup -type BackupJobReferenceApplyConfiguration struct { - // namespace is the namespace of the Job. - // this is always expected to be "openshift-etcd" since the user provided PVC - // is also required to be in "openshift-etcd" - // Required - Namespace *string `json:"namespace,omitempty"` - // name is the name of the Job. - // Required - Name *string `json:"name,omitempty"` -} - -// BackupJobReferenceApplyConfiguration constructs a declarative configuration of the BackupJobReference type for use with -// apply. -func BackupJobReference() *BackupJobReferenceApplyConfiguration { - return &BackupJobReferenceApplyConfiguration{} -} - -// 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 *BackupJobReferenceApplyConfiguration) WithNamespace(value string) *BackupJobReferenceApplyConfiguration { - b.Namespace = &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 *BackupJobReferenceApplyConfiguration) WithName(value string) *BackupJobReferenceApplyConfiguration { - b.Name = &value - return b -} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupjob.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupjob.go new file mode 100644 index 0000000000..ce48a083cf --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupjob.go @@ -0,0 +1,44 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EtcdBackupJobApplyConfiguration represents a declarative configuration of the EtcdBackupJob type for use +// with apply. +type EtcdBackupJobApplyConfiguration struct { + // name of the backup job + Name *string `json:"name,omitempty"` + // namespace of the backup job + Namespace *string `json:"namespace,omitempty"` + // uid of the backup job + UID *string `json:"uid,omitempty"` +} + +// EtcdBackupJobApplyConfiguration constructs a declarative configuration of the EtcdBackupJob type for use with +// apply. +func EtcdBackupJob() *EtcdBackupJobApplyConfiguration { + return &EtcdBackupJobApplyConfiguration{} +} + +// 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 *EtcdBackupJobApplyConfiguration) WithName(value string) *EtcdBackupJobApplyConfiguration { + 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 *EtcdBackupJobApplyConfiguration) WithNamespace(value string) *EtcdBackupJobApplyConfiguration { + 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 *EtcdBackupJobApplyConfiguration) WithUID(value string) *EtcdBackupJobApplyConfiguration { + b.UID = &value + return b +} diff --git a/config/applyconfigurations/config/v1alpha1/backup.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicy.go similarity index 64% rename from config/applyconfigurations/config/v1alpha1/backup.go rename to operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicy.go index f1abc8ab77..e16c3a14c0 100644 --- a/config/applyconfigurations/config/v1alpha1/backup.go +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicy.go @@ -3,87 +3,85 @@ package v1alpha1 import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - internal "github.com/openshift/client-go/config/applyconfigurations/internal" + operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" + internal "github.com/openshift/client-go/operator/applyconfigurations/internal" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BackupApplyConfiguration represents a declarative configuration of the Backup type for use +// EtcdBackupPolicyApplyConfiguration represents a declarative configuration of the EtcdBackupPolicy type for use // with apply. // -// Backup provides configuration for performing backups of the openshift cluster. +// # EtcdBackupPolicy sets an automated schedule for taking backups of the etcd cluster // // Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. -type BackupApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata +type EtcdBackupPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec holds user settable values for configuration - Spec *BackupSpecApplyConfiguration `json:"spec,omitempty"` + Spec *EtcdBackupPolicySpecApplyConfiguration `json:"spec,omitempty"` // status holds observed values from the cluster. They may not be overridden. - Status *configv1alpha1.BackupStatus `json:"status,omitempty"` + Status *EtcdBackupPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// Backup constructs a declarative configuration of the Backup type for use with +// EtcdBackupPolicy constructs a declarative configuration of the EtcdBackupPolicy type for use with // apply. -func Backup(name string) *BackupApplyConfiguration { - b := &BackupApplyConfiguration{} +func EtcdBackupPolicy(name string) *EtcdBackupPolicyApplyConfiguration { + b := &EtcdBackupPolicyApplyConfiguration{} b.WithName(name) - b.WithKind("Backup") - b.WithAPIVersion("config.openshift.io/v1alpha1") + b.WithKind("EtcdBackupPolicy") + b.WithAPIVersion("operator.openshift.io/v1alpha1") return b } -// ExtractBackupFrom extracts the applied configuration owned by fieldManager from -// backup for the specified subresource. Pass an empty string for subresource to extract +// ExtractEtcdBackupPolicyFrom extracts the applied configuration owned by fieldManager from +// etcdBackupPolicy for the specified subresource. Pass an empty string for subresource to extract // the main resource. Common subresources include "status", "scale", etc. -// backup must be a unmodified Backup API object that was retrieved from the Kubernetes API. -// ExtractBackupFrom provides a way to perform a extract/modify-in-place/apply workflow. +// etcdBackupPolicy must be a unmodified EtcdBackupPolicy API object that was retrieved from the Kubernetes API. +// ExtractEtcdBackupPolicyFrom provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractBackupFrom(backup *configv1alpha1.Backup, fieldManager string, subresource string) (*BackupApplyConfiguration, error) { - b := &BackupApplyConfiguration{} - err := managedfields.ExtractInto(backup, internal.Parser().Type("com.github.openshift.api.config.v1alpha1.Backup"), fieldManager, b, subresource) +func ExtractEtcdBackupPolicyFrom(etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, fieldManager string, subresource string) (*EtcdBackupPolicyApplyConfiguration, error) { + b := &EtcdBackupPolicyApplyConfiguration{} + err := managedfields.ExtractInto(etcdBackupPolicy, internal.Parser().Type("com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicy"), fieldManager, b, subresource) if err != nil { return nil, err } - b.WithName(backup.Name) + b.WithName(etcdBackupPolicy.Name) - b.WithKind("Backup") - b.WithAPIVersion("config.openshift.io/v1alpha1") + b.WithKind("EtcdBackupPolicy") + b.WithAPIVersion("operator.openshift.io/v1alpha1") return b, nil } -// ExtractBackup extracts the applied configuration owned by fieldManager from -// backup. If no managedFields are found in backup for fieldManager, a -// BackupApplyConfiguration is returned with only the Name, Namespace (if applicable), +// ExtractEtcdBackupPolicy extracts the applied configuration owned by fieldManager from +// etcdBackupPolicy. If no managedFields are found in etcdBackupPolicy for fieldManager, a +// EtcdBackupPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. -// backup must be a unmodified Backup API object that was retrieved from the Kubernetes API. -// ExtractBackup provides a way to perform a extract/modify-in-place/apply workflow. +// etcdBackupPolicy must be a unmodified EtcdBackupPolicy API object that was retrieved from the Kubernetes API. +// ExtractEtcdBackupPolicy provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractBackup(backup *configv1alpha1.Backup, fieldManager string) (*BackupApplyConfiguration, error) { - return ExtractBackupFrom(backup, fieldManager, "") +func ExtractEtcdBackupPolicy(etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, fieldManager string) (*EtcdBackupPolicyApplyConfiguration, error) { + return ExtractEtcdBackupPolicyFrom(etcdBackupPolicy, fieldManager, "") } -// ExtractBackupStatus extracts the applied configuration owned by fieldManager from -// backup for the status subresource. -func ExtractBackupStatus(backup *configv1alpha1.Backup, fieldManager string) (*BackupApplyConfiguration, error) { - return ExtractBackupFrom(backup, fieldManager, "status") +// ExtractEtcdBackupPolicyStatus extracts the applied configuration owned by fieldManager from +// etcdBackupPolicy for the status subresource. +func ExtractEtcdBackupPolicyStatus(etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, fieldManager string) (*EtcdBackupPolicyApplyConfiguration, error) { + return ExtractEtcdBackupPolicyFrom(etcdBackupPolicy, fieldManager, "status") } -func (b BackupApplyConfiguration) IsApplyConfiguration() {} +func (b EtcdBackupPolicyApplyConfiguration) IsApplyConfiguration() {} // 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 *BackupApplyConfiguration) WithKind(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithKind(value string) *EtcdBackupPolicyApplyConfiguration { b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -91,7 +89,7 @@ func (b *BackupApplyConfiguration) WithKind(value string) *BackupApplyConfigurat // 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 *BackupApplyConfiguration) WithAPIVersion(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithAPIVersion(value string) *EtcdBackupPolicyApplyConfiguration { b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -99,7 +97,7 @@ func (b *BackupApplyConfiguration) WithAPIVersion(value string) *BackupApplyConf // 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 *BackupApplyConfiguration) WithName(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithName(value string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Name = &value return b @@ -108,7 +106,7 @@ func (b *BackupApplyConfiguration) WithName(value string) *BackupApplyConfigurat // 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 *BackupApplyConfiguration) WithGenerateName(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithGenerateName(value string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.GenerateName = &value return b @@ -117,7 +115,7 @@ func (b *BackupApplyConfiguration) WithGenerateName(value string) *BackupApplyCo // 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 *BackupApplyConfiguration) WithNamespace(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithNamespace(value string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Namespace = &value return b @@ -126,7 +124,7 @@ func (b *BackupApplyConfiguration) WithNamespace(value string) *BackupApplyConfi // 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 *BackupApplyConfiguration) WithUID(value types.UID) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithUID(value types.UID) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.UID = &value return b @@ -135,7 +133,7 @@ func (b *BackupApplyConfiguration) WithUID(value types.UID) *BackupApplyConfigur // 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 *BackupApplyConfiguration) WithResourceVersion(value string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithResourceVersion(value string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b @@ -144,7 +142,7 @@ func (b *BackupApplyConfiguration) WithResourceVersion(value string) *BackupAppl // 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 *BackupApplyConfiguration) WithGeneration(value int64) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithGeneration(value int64) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Generation = &value return b @@ -153,7 +151,7 @@ func (b *BackupApplyConfiguration) WithGeneration(value int64) *BackupApplyConfi // 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 *BackupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b @@ -162,7 +160,7 @@ func (b *BackupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *Bac // 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 *BackupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b @@ -171,7 +169,7 @@ func (b *BackupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *Bac // 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 *BackupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b @@ -181,7 +179,7 @@ func (b *BackupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) * // 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 *BackupApplyConfiguration) WithLabels(entries map[string]string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithLabels(entries map[string]string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) @@ -196,7 +194,7 @@ func (b *BackupApplyConfiguration) WithLabels(entries map[string]string) *Backup // 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 *BackupApplyConfiguration) WithAnnotations(entries map[string]string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) @@ -210,7 +208,7 @@ func (b *BackupApplyConfiguration) WithAnnotations(entries map[string]string) *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 *BackupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -224,7 +222,7 @@ func (b *BackupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerRefere // 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 *BackupApplyConfiguration) WithFinalizers(values ...string) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithFinalizers(values ...string) *EtcdBackupPolicyApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) @@ -232,7 +230,7 @@ func (b *BackupApplyConfiguration) WithFinalizers(values ...string) *BackupApply return b } -func (b *BackupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *EtcdBackupPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } @@ -241,7 +239,7 @@ func (b *BackupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { // 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 *BackupApplyConfiguration) WithSpec(value *BackupSpecApplyConfiguration) *BackupApplyConfiguration { +func (b *EtcdBackupPolicyApplyConfiguration) WithSpec(value *EtcdBackupPolicySpecApplyConfiguration) *EtcdBackupPolicyApplyConfiguration { b.Spec = value return b } @@ -249,29 +247,29 @@ func (b *BackupApplyConfiguration) WithSpec(value *BackupSpecApplyConfiguration) // 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 *BackupApplyConfiguration) WithStatus(value configv1alpha1.BackupStatus) *BackupApplyConfiguration { - b.Status = &value +func (b *EtcdBackupPolicyApplyConfiguration) WithStatus(value *EtcdBackupPolicyStatusApplyConfiguration) *EtcdBackupPolicyApplyConfiguration { + b.Status = value return b } // GetKind retrieves the value of the Kind field in the declarative configuration. -func (b *BackupApplyConfiguration) GetKind() *string { +func (b *EtcdBackupPolicyApplyConfiguration) GetKind() *string { return b.TypeMetaApplyConfiguration.Kind } // GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. -func (b *BackupApplyConfiguration) GetAPIVersion() *string { +func (b *EtcdBackupPolicyApplyConfiguration) GetAPIVersion() *string { return b.TypeMetaApplyConfiguration.APIVersion } // GetName retrieves the value of the Name field in the declarative configuration. -func (b *BackupApplyConfiguration) GetName() *string { +func (b *EtcdBackupPolicyApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } // GetNamespace retrieves the value of the Namespace field in the declarative configuration. -func (b *BackupApplyConfiguration) GetNamespace() *string { +func (b *EtcdBackupPolicyApplyConfiguration) GetNamespace() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Namespace } diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyretentionrule.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyretentionrule.go new file mode 100644 index 0000000000..f60463570f --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyretentionrule.go @@ -0,0 +1,50 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// EtcdBackupPolicyRetentionRuleApplyConfiguration represents a declarative configuration of the EtcdBackupPolicyRetentionRule type for use +// with apply. +type EtcdBackupPolicyRetentionRuleApplyConfiguration struct { + // type defined which rule field is set + Type *operatorv1alpha1.EtcdBackupPolicyRetentionRuleType `json:"type,omitempty"` + // maxQuantity enforces the deletion of backups that exceed the given count. + MaxQuantity *int `json:"maxQuantity,omitempty"` + // maxSize enforces the deletion of backups by the total size of backups on the storage backend. + // This is a soft threshold. The total size of backups may temporarily exceed the limit when new backups are created. + MaxSize *resource.Quantity `json:"maxSize,omitempty"` +} + +// EtcdBackupPolicyRetentionRuleApplyConfiguration constructs a declarative configuration of the EtcdBackupPolicyRetentionRule type for use with +// apply. +func EtcdBackupPolicyRetentionRule() *EtcdBackupPolicyRetentionRuleApplyConfiguration { + return &EtcdBackupPolicyRetentionRuleApplyConfiguration{} +} + +// 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 *EtcdBackupPolicyRetentionRuleApplyConfiguration) WithType(value operatorv1alpha1.EtcdBackupPolicyRetentionRuleType) *EtcdBackupPolicyRetentionRuleApplyConfiguration { + b.Type = &value + return b +} + +// WithMaxQuantity sets the MaxQuantity 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 MaxQuantity field is set to the value of the last call. +func (b *EtcdBackupPolicyRetentionRuleApplyConfiguration) WithMaxQuantity(value int) *EtcdBackupPolicyRetentionRuleApplyConfiguration { + b.MaxQuantity = &value + return b +} + +// WithMaxSize sets the MaxSize 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 MaxSize field is set to the value of the last call. +func (b *EtcdBackupPolicyRetentionRuleApplyConfiguration) WithMaxSize(value resource.Quantity) *EtcdBackupPolicyRetentionRuleApplyConfiguration { + b.MaxSize = &value + return b +} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyspec.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyspec.go new file mode 100644 index 0000000000..2e2e512b34 --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicyspec.go @@ -0,0 +1,91 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EtcdBackupPolicySpecApplyConfiguration represents a declarative configuration of the EtcdBackupPolicySpec type for use +// with apply. +type EtcdBackupPolicySpecApplyConfiguration struct { + // schedule sets the backup schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. + Schedule *string `json:"schedule,omitempty"` + // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. + // If not specified, this will default to the time zone of the cluster-etcd-operator process. + TimeZone *string `json:"timeZone,omitempty"` + // nodeSelector specifies which master node(s) to run backup jobs on. + // If no selector is specified, the default node-role.kubernetes.io/master label will be used. + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // nodeCount sets the maximum number of nodes to run backups on when multiple are selected. + // If a value greater than zero is set, nodes are selected in lexicographical order. + // Values less than or equal to zero will select all available nodes. + NodeCount *int `json:"nodeCount,omitempty"` + // storage specifies the location where etcd backup files will be saved. + Storage *EtcdBackupStorageApplyConfiguration `json:"storage,omitempty"` + // retentionRules defines the policy for retaining and deleting existing backups. + // Backups are deleted from the oldest first until all rules are satisfied (logical OR). + // If no rules are specified then backups created by this policy will not be automatically deleted. + RetentionRules []EtcdBackupPolicyRetentionRuleApplyConfiguration `json:"retentionRules,omitempty"` +} + +// EtcdBackupPolicySpecApplyConfiguration constructs a declarative configuration of the EtcdBackupPolicySpec type for use with +// apply. +func EtcdBackupPolicySpec() *EtcdBackupPolicySpecApplyConfiguration { + return &EtcdBackupPolicySpecApplyConfiguration{} +} + +// WithSchedule sets the Schedule 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 Schedule field is set to the value of the last call. +func (b *EtcdBackupPolicySpecApplyConfiguration) WithSchedule(value string) *EtcdBackupPolicySpecApplyConfiguration { + b.Schedule = &value + return b +} + +// WithTimeZone sets the TimeZone 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 TimeZone field is set to the value of the last call. +func (b *EtcdBackupPolicySpecApplyConfiguration) WithTimeZone(value string) *EtcdBackupPolicySpecApplyConfiguration { + b.TimeZone = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *EtcdBackupPolicySpecApplyConfiguration) WithNodeSelector(entries map[string]string) *EtcdBackupPolicySpecApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithNodeCount sets the NodeCount 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 NodeCount field is set to the value of the last call. +func (b *EtcdBackupPolicySpecApplyConfiguration) WithNodeCount(value int) *EtcdBackupPolicySpecApplyConfiguration { + b.NodeCount = &value + return b +} + +// 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 *EtcdBackupPolicySpecApplyConfiguration) WithStorage(value *EtcdBackupStorageApplyConfiguration) *EtcdBackupPolicySpecApplyConfiguration { + b.Storage = value + return b +} + +// WithRetentionRules adds the given value to the RetentionRules 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 RetentionRules field. +func (b *EtcdBackupPolicySpecApplyConfiguration) WithRetentionRules(values ...*EtcdBackupPolicyRetentionRuleApplyConfiguration) *EtcdBackupPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRetentionRules") + } + b.RetentionRules = append(b.RetentionRules, *values[i]) + } + return b +} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicystatus.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicystatus.go new file mode 100644 index 0000000000..5cdf3814ba --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackuppolicystatus.go @@ -0,0 +1,42 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EtcdBackupPolicyStatusApplyConfiguration represents a declarative configuration of the EtcdBackupPolicyStatus type for use +// with apply. +type EtcdBackupPolicyStatusApplyConfiguration struct { + // lastScheduleTime is the time when the last scheduled backup was triggered. + // This is used by the controller to track when backups have been executed + // and to prevent duplicate executions on controller restart. + LastScheduleTime *v1.Time `json:"lastScheduleTime,omitempty"` + // lastScheduleNodes is the name of nodes selected during the last scheduled execution. + LastScheduleNodes []string `json:"lastScheduleNodes,omitempty"` +} + +// EtcdBackupPolicyStatusApplyConfiguration constructs a declarative configuration of the EtcdBackupPolicyStatus type for use with +// apply. +func EtcdBackupPolicyStatus() *EtcdBackupPolicyStatusApplyConfiguration { + return &EtcdBackupPolicyStatusApplyConfiguration{} +} + +// WithLastScheduleTime sets the LastScheduleTime 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 LastScheduleTime field is set to the value of the last call. +func (b *EtcdBackupPolicyStatusApplyConfiguration) WithLastScheduleTime(value v1.Time) *EtcdBackupPolicyStatusApplyConfiguration { + b.LastScheduleTime = &value + return b +} + +// WithLastScheduleNodes adds the given value to the LastScheduleNodes 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 LastScheduleNodes field. +func (b *EtcdBackupPolicyStatusApplyConfiguration) WithLastScheduleNodes(values ...string) *EtcdBackupPolicyStatusApplyConfiguration { + for i := range values { + b.LastScheduleNodes = append(b.LastScheduleNodes, values[i]) + } + return b +} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupspec.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupspec.go index e6bfee0bf5..7ecaf9f692 100644 --- a/operator/applyconfigurations/operator/v1alpha1/etcdbackupspec.go +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupspec.go @@ -5,12 +5,11 @@ package v1alpha1 // EtcdBackupSpecApplyConfiguration represents a declarative configuration of the EtcdBackupSpec type for use // with apply. type EtcdBackupSpecApplyConfiguration struct { - // pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the - // etcd backup file would be saved - // The PVC itself must always be created in the "openshift-etcd" namespace - // If the PVC is left unspecified "" then the platform will choose a reasonable default location to save the backup. - // In the future this would be backups saved across the control-plane master nodes. - PVCName *string `json:"pvcName,omitempty"` + // nodeName specifies the master node where an etcd backup should be taken. + // If not specified, a random master node will be selected. + NodeName *string `json:"nodeName,omitempty"` + // storage specifies the location where etcd backup files will be saved. + Storage *EtcdBackupStorageApplyConfiguration `json:"storage,omitempty"` } // EtcdBackupSpecApplyConfiguration constructs a declarative configuration of the EtcdBackupSpec type for use with @@ -19,10 +18,18 @@ func EtcdBackupSpec() *EtcdBackupSpecApplyConfiguration { return &EtcdBackupSpecApplyConfiguration{} } -// WithPVCName sets the PVCName field in the declarative configuration to the given value +// WithNodeName sets the NodeName 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 PVCName field is set to the value of the last call. -func (b *EtcdBackupSpecApplyConfiguration) WithPVCName(value string) *EtcdBackupSpecApplyConfiguration { - b.PVCName = &value +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *EtcdBackupSpecApplyConfiguration) WithNodeName(value string) *EtcdBackupSpecApplyConfiguration { + b.NodeName = &value + return b +} + +// 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 *EtcdBackupSpecApplyConfiguration) WithStorage(value *EtcdBackupStorageApplyConfiguration) *EtcdBackupSpecApplyConfiguration { + b.Storage = value return b } diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupstatus.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstatus.go index 3af48c275a..71759cff00 100644 --- a/operator/applyconfigurations/operator/v1alpha1/etcdbackupstatus.go +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstatus.go @@ -3,6 +3,7 @@ package v1alpha1 import ( + resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -11,9 +12,14 @@ import ( type EtcdBackupStatusApplyConfiguration struct { // conditions provide details on the status of the etcd backup job. Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` - // backupJob is the reference to the Job that executes the backup. - // Optional - BackupJob *BackupJobReferenceApplyConfiguration `json:"backupJob,omitempty"` + // job is a reference to the Job created for the backup. + Job *EtcdBackupJobApplyConfiguration `json:"job,omitempty"` + // nodeName is the master node where the backup snapshot was taken. + NodeName *string `json:"nodeName,omitempty"` + // filePath is the absolute path to the backup file on the storage backend. + FilePath *string `json:"filePath,omitempty"` + // fileSize is the size of the backup file on the storage backend. + FileSize *resource.Quantity `json:"fileSize,omitempty"` } // EtcdBackupStatusApplyConfiguration constructs a declarative configuration of the EtcdBackupStatus type for use with @@ -35,10 +41,34 @@ func (b *EtcdBackupStatusApplyConfiguration) WithConditions(values ...*v1.Condit return b } -// WithBackupJob sets the BackupJob field in the declarative configuration to the given value +// WithJob sets the Job 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 BackupJob field is set to the value of the last call. -func (b *EtcdBackupStatusApplyConfiguration) WithBackupJob(value *BackupJobReferenceApplyConfiguration) *EtcdBackupStatusApplyConfiguration { - b.BackupJob = value +// If called multiple times, the Job field is set to the value of the last call. +func (b *EtcdBackupStatusApplyConfiguration) WithJob(value *EtcdBackupJobApplyConfiguration) *EtcdBackupStatusApplyConfiguration { + b.Job = value + return b +} + +// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call. +func (b *EtcdBackupStatusApplyConfiguration) WithNodeName(value string) *EtcdBackupStatusApplyConfiguration { + b.NodeName = &value + return b +} + +// WithFilePath sets the FilePath 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 FilePath field is set to the value of the last call. +func (b *EtcdBackupStatusApplyConfiguration) WithFilePath(value string) *EtcdBackupStatusApplyConfiguration { + b.FilePath = &value + return b +} + +// WithFileSize sets the FileSize 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 FileSize field is set to the value of the last call. +func (b *EtcdBackupStatusApplyConfiguration) WithFileSize(value resource.Quantity) *EtcdBackupStatusApplyConfiguration { + b.FileSize = &value return b } diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupstorage.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstorage.go new file mode 100644 index 0000000000..e5e397428a --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstorage.go @@ -0,0 +1,50 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" +) + +// EtcdBackupStorageApplyConfiguration represents a declarative configuration of the EtcdBackupStorage type for use +// with apply. +type EtcdBackupStorageApplyConfiguration struct { + Type *operatorv1alpha1.EtcdBackupStorageType `json:"type,omitempty"` + // pvc specifies the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file will be saved. + // The PVC must always be created in the "openshift-etcd" namespace. + // This field is required when the storage type is "PVC" + PVC *EtcdBackupStoragePvcApplyConfiguration `json:"pvc,omitempty"` + // local specifies a host path directory on the master node where the etcd backup file will be saved. + // This field is required when storage type is "Local" + Local *EtcdBackupStorageLocalApplyConfiguration `json:"local,omitempty"` +} + +// EtcdBackupStorageApplyConfiguration constructs a declarative configuration of the EtcdBackupStorage type for use with +// apply. +func EtcdBackupStorage() *EtcdBackupStorageApplyConfiguration { + return &EtcdBackupStorageApplyConfiguration{} +} + +// 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 *EtcdBackupStorageApplyConfiguration) WithType(value operatorv1alpha1.EtcdBackupStorageType) *EtcdBackupStorageApplyConfiguration { + b.Type = &value + return b +} + +// WithPVC sets the PVC 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 PVC field is set to the value of the last call. +func (b *EtcdBackupStorageApplyConfiguration) WithPVC(value *EtcdBackupStoragePvcApplyConfiguration) *EtcdBackupStorageApplyConfiguration { + b.PVC = value + return b +} + +// WithLocal sets the Local field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Local field is set to the value of the last call. +func (b *EtcdBackupStorageApplyConfiguration) WithLocal(value *EtcdBackupStorageLocalApplyConfiguration) *EtcdBackupStorageApplyConfiguration { + b.Local = value + return b +} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragelocal.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragelocal.go new file mode 100644 index 0000000000..1b0afd106f --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragelocal.go @@ -0,0 +1,24 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EtcdBackupStorageLocalApplyConfiguration represents a declarative configuration of the EtcdBackupStorageLocal type for use +// with apply. +type EtcdBackupStorageLocalApplyConfiguration struct { + // hostPath is a local directory on the master node where the etcd backup file will be saved. + HostPath *string `json:"hostPath,omitempty"` +} + +// EtcdBackupStorageLocalApplyConfiguration constructs a declarative configuration of the EtcdBackupStorageLocal type for use with +// apply. +func EtcdBackupStorageLocal() *EtcdBackupStorageLocalApplyConfiguration { + return &EtcdBackupStorageLocalApplyConfiguration{} +} + +// WithHostPath sets the HostPath 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 HostPath field is set to the value of the last call. +func (b *EtcdBackupStorageLocalApplyConfiguration) WithHostPath(value string) *EtcdBackupStorageLocalApplyConfiguration { + b.HostPath = &value + return b +} diff --git a/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragepvc.go b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragepvc.go new file mode 100644 index 0000000000..fbd1a7d319 --- /dev/null +++ b/operator/applyconfigurations/operator/v1alpha1/etcdbackupstoragepvc.go @@ -0,0 +1,34 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EtcdBackupStoragePvcApplyConfiguration represents a declarative configuration of the EtcdBackupStoragePvc type for use +// with apply. +type EtcdBackupStoragePvcApplyConfiguration struct { + // name is a reference to a PVC in the "openshift-etcd" namespace where the etcd backup file will be saved. + Name *string `json:"name,omitempty"` + // path is a directory on the volume where the etcd backup file will be saved. + Path *string `json:"path,omitempty"` +} + +// EtcdBackupStoragePvcApplyConfiguration constructs a declarative configuration of the EtcdBackupStoragePvc type for use with +// apply. +func EtcdBackupStoragePvc() *EtcdBackupStoragePvcApplyConfiguration { + return &EtcdBackupStoragePvcApplyConfiguration{} +} + +// 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 *EtcdBackupStoragePvcApplyConfiguration) WithName(value string) *EtcdBackupStoragePvcApplyConfiguration { + b.Name = &value + return b +} + +// WithPath sets the Path 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 Path field is set to the value of the last call. +func (b *EtcdBackupStoragePvcApplyConfiguration) WithPath(value string) *EtcdBackupStoragePvcApplyConfiguration { + b.Path = &value + return b +} diff --git a/operator/applyconfigurations/utils.go b/operator/applyconfigurations/utils.go index 39a52833f7..21b63d2497 100644 --- a/operator/applyconfigurations/utils.go +++ b/operator/applyconfigurations/utils.go @@ -464,8 +464,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &operatorv1.VSphereCSIDriverConfigSpecApplyConfiguration{} // Group=operator.openshift.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithKind("BackupJobReference"): - return &operatorv1alpha1.BackupJobReferenceApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ClusterAPI"): return &operatorv1alpha1.ClusterAPIApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ClusterAPIInstallerComponent"): @@ -490,10 +488,26 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &operatorv1alpha1.ClusterVersionOperatorStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackup"): return &operatorv1alpha1.EtcdBackupApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupJob"): + return &operatorv1alpha1.EtcdBackupJobApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupPolicy"): + return &operatorv1alpha1.EtcdBackupPolicyApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupPolicyRetentionRule"): + return &operatorv1alpha1.EtcdBackupPolicyRetentionRuleApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupPolicySpec"): + return &operatorv1alpha1.EtcdBackupPolicySpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupPolicyStatus"): + return &operatorv1alpha1.EtcdBackupPolicyStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupSpec"): return &operatorv1alpha1.EtcdBackupSpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupStatus"): return &operatorv1alpha1.EtcdBackupStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupStorage"): + return &operatorv1alpha1.EtcdBackupStorageApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupStorageLocal"): + return &operatorv1alpha1.EtcdBackupStorageLocalApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupStoragePvc"): + return &operatorv1alpha1.EtcdBackupStoragePvcApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ImageContentSourcePolicy"): return &operatorv1alpha1.ImageContentSourcePolicyApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ImageContentSourcePolicySpec"): diff --git a/operator/clientset/versioned/typed/operator/v1alpha1/etcdbackuppolicy.go b/operator/clientset/versioned/typed/operator/v1alpha1/etcdbackuppolicy.go new file mode 100644 index 0000000000..1d7c90a0aa --- /dev/null +++ b/operator/clientset/versioned/typed/operator/v1alpha1/etcdbackuppolicy.go @@ -0,0 +1,58 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" + applyconfigurationsoperatorv1alpha1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1alpha1" + scheme "github.com/openshift/client-go/operator/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// EtcdBackupPoliciesGetter has a method to return a EtcdBackupPolicyInterface. +// A group's client should implement this interface. +type EtcdBackupPoliciesGetter interface { + EtcdBackupPolicies() EtcdBackupPolicyInterface +} + +// EtcdBackupPolicyInterface has methods to work with EtcdBackupPolicy resources. +type EtcdBackupPolicyInterface interface { + Create(ctx context.Context, etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, opts v1.CreateOptions) (*operatorv1alpha1.EtcdBackupPolicy, error) + Update(ctx context.Context, etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, opts v1.UpdateOptions) (*operatorv1alpha1.EtcdBackupPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, etcdBackupPolicy *operatorv1alpha1.EtcdBackupPolicy, opts v1.UpdateOptions) (*operatorv1alpha1.EtcdBackupPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*operatorv1alpha1.EtcdBackupPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*operatorv1alpha1.EtcdBackupPolicyList, 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 *operatorv1alpha1.EtcdBackupPolicy, err error) + Apply(ctx context.Context, etcdBackupPolicy *applyconfigurationsoperatorv1alpha1.EtcdBackupPolicyApplyConfiguration, opts v1.ApplyOptions) (result *operatorv1alpha1.EtcdBackupPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, etcdBackupPolicy *applyconfigurationsoperatorv1alpha1.EtcdBackupPolicyApplyConfiguration, opts v1.ApplyOptions) (result *operatorv1alpha1.EtcdBackupPolicy, err error) + EtcdBackupPolicyExpansion +} + +// etcdBackupPolicies implements EtcdBackupPolicyInterface +type etcdBackupPolicies struct { + *gentype.ClientWithListAndApply[*operatorv1alpha1.EtcdBackupPolicy, *operatorv1alpha1.EtcdBackupPolicyList, *applyconfigurationsoperatorv1alpha1.EtcdBackupPolicyApplyConfiguration] +} + +// newEtcdBackupPolicies returns a EtcdBackupPolicies +func newEtcdBackupPolicies(c *OperatorV1alpha1Client) *etcdBackupPolicies { + return &etcdBackupPolicies{ + gentype.NewClientWithListAndApply[*operatorv1alpha1.EtcdBackupPolicy, *operatorv1alpha1.EtcdBackupPolicyList, *applyconfigurationsoperatorv1alpha1.EtcdBackupPolicyApplyConfiguration]( + "etcdbackuppolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *operatorv1alpha1.EtcdBackupPolicy { return &operatorv1alpha1.EtcdBackupPolicy{} }, + func() *operatorv1alpha1.EtcdBackupPolicyList { return &operatorv1alpha1.EtcdBackupPolicyList{} }, + ), + } +} diff --git a/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_etcdbackuppolicy.go b/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_etcdbackuppolicy.go new file mode 100644 index 0000000000..35b313bd8e --- /dev/null +++ b/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_etcdbackuppolicy.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/openshift/api/operator/v1alpha1" + operatorv1alpha1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1alpha1" + typedoperatorv1alpha1 "github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeEtcdBackupPolicies implements EtcdBackupPolicyInterface +type fakeEtcdBackupPolicies struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.EtcdBackupPolicy, *v1alpha1.EtcdBackupPolicyList, *operatorv1alpha1.EtcdBackupPolicyApplyConfiguration] + Fake *FakeOperatorV1alpha1 +} + +func newFakeEtcdBackupPolicies(fake *FakeOperatorV1alpha1) typedoperatorv1alpha1.EtcdBackupPolicyInterface { + return &fakeEtcdBackupPolicies{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.EtcdBackupPolicy, *v1alpha1.EtcdBackupPolicyList, *operatorv1alpha1.EtcdBackupPolicyApplyConfiguration]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("etcdbackuppolicies"), + v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupPolicy"), + func() *v1alpha1.EtcdBackupPolicy { return &v1alpha1.EtcdBackupPolicy{} }, + func() *v1alpha1.EtcdBackupPolicyList { return &v1alpha1.EtcdBackupPolicyList{} }, + func(dst, src *v1alpha1.EtcdBackupPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.EtcdBackupPolicyList) []*v1alpha1.EtcdBackupPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.EtcdBackupPolicyList, items []*v1alpha1.EtcdBackupPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_operator_client.go b/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_operator_client.go index 67792010a4..67a8d7afe7 100644 --- a/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_operator_client.go +++ b/operator/clientset/versioned/typed/operator/v1alpha1/fake/fake_operator_client.go @@ -24,6 +24,10 @@ func (c *FakeOperatorV1alpha1) EtcdBackups() v1alpha1.EtcdBackupInterface { return newFakeEtcdBackups(c) } +func (c *FakeOperatorV1alpha1) EtcdBackupPolicies() v1alpha1.EtcdBackupPolicyInterface { + return newFakeEtcdBackupPolicies(c) +} + func (c *FakeOperatorV1alpha1) ImageContentSourcePolicies() v1alpha1.ImageContentSourcePolicyInterface { return newFakeImageContentSourcePolicies(c) } diff --git a/operator/clientset/versioned/typed/operator/v1alpha1/generated_expansion.go b/operator/clientset/versioned/typed/operator/v1alpha1/generated_expansion.go index a19ef54dc1..ac3d8d2c7a 100644 --- a/operator/clientset/versioned/typed/operator/v1alpha1/generated_expansion.go +++ b/operator/clientset/versioned/typed/operator/v1alpha1/generated_expansion.go @@ -8,6 +8,8 @@ type ClusterVersionOperatorExpansion interface{} type EtcdBackupExpansion interface{} +type EtcdBackupPolicyExpansion interface{} + type ImageContentSourcePolicyExpansion interface{} type OLMExpansion interface{} diff --git a/operator/clientset/versioned/typed/operator/v1alpha1/operator_client.go b/operator/clientset/versioned/typed/operator/v1alpha1/operator_client.go index 6ed123d5e3..ec5bc1e616 100644 --- a/operator/clientset/versioned/typed/operator/v1alpha1/operator_client.go +++ b/operator/clientset/versioned/typed/operator/v1alpha1/operator_client.go @@ -15,6 +15,7 @@ type OperatorV1alpha1Interface interface { ClusterAPIsGetter ClusterVersionOperatorsGetter EtcdBackupsGetter + EtcdBackupPoliciesGetter ImageContentSourcePoliciesGetter OLMsGetter } @@ -36,6 +37,10 @@ func (c *OperatorV1alpha1Client) EtcdBackups() EtcdBackupInterface { return newEtcdBackups(c) } +func (c *OperatorV1alpha1Client) EtcdBackupPolicies() EtcdBackupPolicyInterface { + return newEtcdBackupPolicies(c) +} + func (c *OperatorV1alpha1Client) ImageContentSourcePolicies() ImageContentSourcePolicyInterface { return newImageContentSourcePolicies(c) } diff --git a/operator/informers/externalversions/generic.go b/operator/informers/externalversions/generic.go index 327a1b6e89..bf1ea75def 100644 --- a/operator/informers/externalversions/generic.go +++ b/operator/informers/externalversions/generic.go @@ -92,6 +92,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1alpha1().ClusterVersionOperators().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("etcdbackups"): return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1alpha1().EtcdBackups().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("etcdbackuppolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1alpha1().EtcdBackupPolicies().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("imagecontentsourcepolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1alpha1().ImageContentSourcePolicies().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("olms"): diff --git a/operator/informers/externalversions/operator/v1alpha1/etcdbackuppolicy.go b/operator/informers/externalversions/operator/v1alpha1/etcdbackuppolicy.go new file mode 100644 index 0000000000..46c2412d90 --- /dev/null +++ b/operator/informers/externalversions/operator/v1alpha1/etcdbackuppolicy.go @@ -0,0 +1,99 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apioperatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" + versioned "github.com/openshift/client-go/operator/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/operator/informers/externalversions/internalinterfaces" + operatorv1alpha1 "github.com/openshift/client-go/operator/listers/operator/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EtcdBackupPolicyInformer provides access to a shared informer and lister for +// EtcdBackupPolicies. +type EtcdBackupPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() operatorv1alpha1.EtcdBackupPolicyLister +} + +type etcdBackupPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewEtcdBackupPolicyInformer constructs a new informer for EtcdBackupPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEtcdBackupPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewEtcdBackupPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewFilteredEtcdBackupPolicyInformer constructs a new informer for EtcdBackupPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEtcdBackupPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewEtcdBackupPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewEtcdBackupPolicyInformerWithOptions constructs a new informer for EtcdBackupPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEtcdBackupPolicyInformerWithOptions(client versioned.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + gvr := schema.GroupVersionResource{Group: "operator.openshift.io", Version: "v1alpha1", Resource: "etcdbackuppolicys"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.OperatorV1alpha1().EtcdBackupPolicies().List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.OperatorV1alpha1().EtcdBackupPolicies().Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.OperatorV1alpha1().EtcdBackupPolicies().List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.OperatorV1alpha1().EtcdBackupPolicies().Watch(ctx, opts) + }, + }, client), + &apioperatorv1alpha1.EtcdBackupPolicy{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + ) +} + +func (f *etcdBackupPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewEtcdBackupPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *etcdBackupPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apioperatorv1alpha1.EtcdBackupPolicy{}, f.defaultInformer) +} + +func (f *etcdBackupPolicyInformer) Lister() operatorv1alpha1.EtcdBackupPolicyLister { + return operatorv1alpha1.NewEtcdBackupPolicyLister(f.Informer().GetIndexer()) +} diff --git a/operator/informers/externalversions/operator/v1alpha1/interface.go b/operator/informers/externalversions/operator/v1alpha1/interface.go index cff20e8060..664ca9d186 100644 --- a/operator/informers/externalversions/operator/v1alpha1/interface.go +++ b/operator/informers/externalversions/operator/v1alpha1/interface.go @@ -14,6 +14,8 @@ type Interface interface { ClusterVersionOperators() ClusterVersionOperatorInformer // EtcdBackups returns a EtcdBackupInformer. EtcdBackups() EtcdBackupInformer + // EtcdBackupPolicies returns a EtcdBackupPolicyInformer. + EtcdBackupPolicies() EtcdBackupPolicyInformer // ImageContentSourcePolicies returns a ImageContentSourcePolicyInformer. ImageContentSourcePolicies() ImageContentSourcePolicyInformer // OLMs returns a OLMInformer. @@ -46,6 +48,11 @@ func (v *version) EtcdBackups() EtcdBackupInformer { return &etcdBackupInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// EtcdBackupPolicies returns a EtcdBackupPolicyInformer. +func (v *version) EtcdBackupPolicies() EtcdBackupPolicyInformer { + return &etcdBackupPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ImageContentSourcePolicies returns a ImageContentSourcePolicyInformer. func (v *version) ImageContentSourcePolicies() ImageContentSourcePolicyInformer { return &imageContentSourcePolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/operator/listers/operator/v1alpha1/etcdbackuppolicy.go b/operator/listers/operator/v1alpha1/etcdbackuppolicy.go new file mode 100644 index 0000000000..d87395ac7f --- /dev/null +++ b/operator/listers/operator/v1alpha1/etcdbackuppolicy.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EtcdBackupPolicyLister helps list EtcdBackupPolicies. +// All objects returned here must be treated as read-only. +type EtcdBackupPolicyLister interface { + // List lists all EtcdBackupPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*operatorv1alpha1.EtcdBackupPolicy, err error) + // Get retrieves the EtcdBackupPolicy from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*operatorv1alpha1.EtcdBackupPolicy, error) + EtcdBackupPolicyListerExpansion +} + +// etcdBackupPolicyLister implements the EtcdBackupPolicyLister interface. +type etcdBackupPolicyLister struct { + listers.ResourceIndexer[*operatorv1alpha1.EtcdBackupPolicy] +} + +// NewEtcdBackupPolicyLister returns a new EtcdBackupPolicyLister. +func NewEtcdBackupPolicyLister(indexer cache.Indexer) EtcdBackupPolicyLister { + return &etcdBackupPolicyLister{listers.New[*operatorv1alpha1.EtcdBackupPolicy](indexer, operatorv1alpha1.Resource("etcdbackuppolicy"))} +} diff --git a/operator/listers/operator/v1alpha1/expansion_generated.go b/operator/listers/operator/v1alpha1/expansion_generated.go index 5380503733..43ae301727 100644 --- a/operator/listers/operator/v1alpha1/expansion_generated.go +++ b/operator/listers/operator/v1alpha1/expansion_generated.go @@ -14,6 +14,10 @@ type ClusterVersionOperatorListerExpansion interface{} // EtcdBackupLister. type EtcdBackupListerExpansion interface{} +// EtcdBackupPolicyListerExpansion allows custom methods to be added to +// EtcdBackupPolicyLister. +type EtcdBackupPolicyListerExpansion interface{} + // ImageContentSourcePolicyListerExpansion allows custom methods to be added to // ImageContentSourcePolicyLister. type ImageContentSourcePolicyListerExpansion interface{} diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index 5d9f10374e..86c98664df 100644 --- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -210,6 +210,21 @@ const ( DNSRecordsTypeInternal DNSRecordsType = "Internal" ) +// VIPManagementType defines which mechanism manages the API and Ingress +// VIPs on an on-premise cluster. +// +kubebuilder:validation:Enum=Keepalived;BGP +// +enum +type VIPManagementType string + +const ( + // VIPManagementTypeKeepalived means the VIPs are managed by the default + // keepalived/VRRP mechanism. + VIPManagementTypeKeepalived VIPManagementType = "Keepalived" + // VIPManagementTypeBGP means the VIPs are advertised via BGP by kube-vip + // (Routing Table Mode) and frr-k8s running as static pods. + VIPManagementTypeBGP VIPManagementType = "BGP" +) + // PlatformType is a specific supported infrastructure provider. // +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External type PlatformType string @@ -1074,6 +1089,21 @@ type BareMetalPlatformStatus struct { // +optional LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"` + // vipManagement indicates which VIP management mechanism is active + // on this cluster. + // Allowed values are `Keepalived`, `BGP`, and omitted. + // Once set to a non-empty value, this field is immutable. + // When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are + // deployed as static pods to advertise VIPs via BGP, replacing the + // default keepalived/VRRP mechanism. + // When set to `Keepalived`, the default keepalived-based VIP + // management is used. + // When omitted, the default keepalived-based VIP management is used. + // +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="vipManagement is immutable once set" + // +openshift:enable:FeatureGate=BGPBasedVIPManagement + // +optional + VIPManagement VIPManagementType `json:"vipManagement,omitempty"` + // dnsRecordsType determines whether records for api, api-int, and ingress // are provided by the internal DNS service or externally. // Allowed values are `Internal`, `External`, and omitted. diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml index 76f78df82d..7707626383 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml @@ -397,6 +397,7 @@ infrastructures.config.openshift.io: - AWSClusterHostedDNSInstall - AWSDualStackInstall - AzureDualStackInstall + - BGPBasedVIPManagement - DualReplica - DyanmicServiceEndpointIBMCloud - MutableTopology diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index b147c20ec1..b763c1b531 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -1698,6 +1698,7 @@ var map_BareMetalPlatformStatus = map[string]string{ "ingressIPs": "ingressIPs are the external IPs which route to the default ingress controller. The IPs are suitable targets of a wildcard DNS record used to resolve default route host names. In dual stack clusters this list contains two IPs otherwise only one.", "nodeDNSIP": "nodeDNSIP is the IP address for the internal DNS used by the nodes. Unlike the one managed by the DNS operator, `NodeDNSIP` provides name resolution for the nodes themselves. There is no DNS-as-a-service for BareMetal deployments. In order to minimize necessary changes to the datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames to the nodes in the cluster.", "loadBalancer": "loadBalancer defines how the load balancer used by the cluster is configured.", + "vipManagement": "vipManagement indicates which VIP management mechanism is active on this cluster. Allowed values are `Keepalived`, `BGP`, and omitted. Once set to a non-empty value, this field is immutable. When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are deployed as static pods to advertise VIPs via BGP, replacing the default keepalived/VRRP mechanism. When set to `Keepalived`, the default keepalived-based VIP management is used. When omitted, the default keepalived-based VIP management is used.", "dnsRecordsType": "dnsRecordsType determines whether records for api, api-int, and ingress are provided by the internal DNS service or externally. Allowed values are `Internal`, `External`, and omitted. When set to `Internal`, records are provided by the internal infrastructure and no additional user configuration is required for the cluster to function. When set to `External`, records are not provided by the internal infrastructure and must be configured by the user on a DNS server outside the cluster. Cluster nodes must use this external server for their upstream DNS requests. This value may only be set when loadBalancer.type is set to UserManaged. When omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is `Internal`.", "machineNetworks": "machineNetworks are IP networks used to connect all the OpenShift cluster nodes.", } diff --git a/vendor/github.com/openshift/api/config/v1alpha1/register.go b/vendor/github.com/openshift/api/config/v1alpha1/register.go index 1d84b71079..b0c015e9dd 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/register.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/register.go @@ -34,8 +34,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterMonitoringList{}, &InsightsDataGather{}, &InsightsDataGatherList{}, - &Backup{}, - &BackupList{}, &CRIOCredentialProviderConfig{}, &CRIOCredentialProviderConfigList{}, &PKI{}, diff --git a/vendor/github.com/openshift/api/config/v1alpha1/types_backup.go b/vendor/github.com/openshift/api/config/v1alpha1/types_backup.go deleted file mode 100644 index 0f3da51847..0000000000 --- a/vendor/github.com/openshift/api/config/v1alpha1/types_backup.go +++ /dev/null @@ -1,162 +0,0 @@ -package v1alpha1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// -// Backup provides configuration for performing backups of the openshift cluster. -// -// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=backups,scope=Cluster -// +kubebuilder:subresource:status -// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/1482 -// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 -// +openshift:enable:FeatureGate=AutomatedEtcdBackup -// +openshift:compatibility-gen:level=4 -type Backup struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - // spec holds user settable values for configuration - // +required - Spec BackupSpec `json:"spec"` - // status holds observed values from the cluster. They may not be overridden. - // +optional - Status BackupStatus `json:"status"` -} - -type BackupSpec struct { - // etcd specifies the configuration for periodic backups of the etcd cluster - // +required - EtcdBackupSpec EtcdBackupSpec `json:"etcd"` -} - -type BackupStatus struct { -} - -// EtcdBackupSpec provides configuration for automated etcd backups to the cluster-etcd-operator -type EtcdBackupSpec struct { - - // schedule defines the recurring backup schedule in Cron format - // every 2 hours: 0 */2 * * * - // every day at 3am: 0 3 * * * - // Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. - // The current default is "no backups", but will change in the future. - // +optional - // +kubebuilder:validation:Pattern:=`^(@(annually|yearly|monthly|weekly|daily|hourly))|(\*|(?:\*|(?:[0-9]|(?:[1-5][0-9])))\/(?:[0-9]|(?:[1-5][0-9]))|(?:[0-9]|(?:[1-5][0-9]))(?:(?:\-[0-9]|\-(?:[1-5][0-9]))?|(?:\,(?:[0-9]|(?:[1-5][0-9])))*)) (\*|(?:\*|(?:\*|(?:[0-9]|1[0-9]|2[0-3])))\/(?:[0-9]|1[0-9]|2[0-3])|(?:[0-9]|1[0-9]|2[0-3])(?:(?:\-(?:[0-9]|1[0-9]|2[0-3]))?|(?:\,(?:[0-9]|1[0-9]|2[0-3]))*)) (\*|(?:[1-9]|(?:[12][0-9])|3[01])(?:(?:\-(?:[1-9]|(?:[12][0-9])|3[01]))?|(?:\,(?:[1-9]|(?:[12][0-9])|3[01]))*)) (\*|(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:\-(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?|(?:\,(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))*)) (\*|(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT)(?:(?:\-(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT))?|(?:\,(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT))*))$` - Schedule string `json:"schedule"` - - // Cron Regex breakdown: - // Allow macros: (@(annually|yearly|monthly|weekly|daily|hourly)) - // OR - // Minute: - // (\*|(?:\*|(?:[0-9]|(?:[1-5][0-9])))\/(?:[0-9]|(?:[1-5][0-9]))|(?:[0-9]|(?:[1-5][0-9]))(?:(?:\-[0-9]|\-(?:[1-5][0-9]))?|(?:\,(?:[0-9]|(?:[1-5][0-9])))*)) - // Hour: - // (\*|(?:\*|(?:\*|(?:[0-9]|1[0-9]|2[0-3])))\/(?:[0-9]|1[0-9]|2[0-3])|(?:[0-9]|1[0-9]|2[0-3])(?:(?:\-(?:[0-9]|1[0-9]|2[0-3]))?|(?:\,(?:[0-9]|1[0-9]|2[0-3]))*)) - // Day of the Month: - // (\*|(?:[1-9]|(?:[12][0-9])|3[01])(?:(?:\-(?:[1-9]|(?:[12][0-9])|3[01]))?|(?:\,(?:[1-9]|(?:[12][0-9])|3[01]))*)) - // Month: - // (\*|(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:\-(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?|(?:\,(?:[1-9]|1[012]|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))*)) - // Day of Week: - // (\*|(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT)(?:(?:\-(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT))?|(?:\,(?:[0-6]|SUN|MON|TUE|WED|THU|FRI|SAT))*)) - // - - // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. - // If not specified, this will default to the time zone of the kube-controller-manager process. - // See https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones - // +optional - // +kubebuilder:validation:Pattern:=`^([A-Za-z_]+([+-]*0)*|[A-Za-z_]+(\/[A-Za-z_]+){1,2})(\/GMT[+-]\d{1,2})?$` - TimeZone string `json:"timeZone"` - - // Timezone regex breakdown: - // ([A-Za-z_]+([+-]*0)*|[A-Za-z_]+(/[A-Za-z_]+){1,2}) - Matches either: - // [A-Za-z_]+([+-]*0)* - One or more alphabetical characters (uppercase or lowercase) or underscores, followed by a +0 or -0 to account for GMT+0 or GMT-0 (for the first part of the timezone identifier). - // [A-Za-z_]+(/[A-Za-z_]+){1,2} - One or more alphabetical characters (uppercase or lowercase) or underscores, followed by one or two occurrences of a forward slash followed by one or more alphabetical characters or underscores. This allows for matching timezone identifiers with 2 or 3 parts, e.g America/Argentina/Buenos_Aires - // (/GMT[+-]\d{1,2})? - Makes the GMT offset suffix optional. It matches "/GMT" followed by either a plus ("+") or minus ("-") sign and one or two digits (the GMT offset) - - // retentionPolicy defines the retention policy for retaining and deleting existing backups. - // +optional - RetentionPolicy RetentionPolicy `json:"retentionPolicy"` - - // pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the - // etcd backup files would be saved - // The PVC itself must always be created in the "openshift-etcd" namespace - // If the PVC is left unspecified "" then the platform will choose a reasonable default location to save the backup. - // In the future this would be backups saved across the control-plane master nodes. - // +optional - PVCName string `json:"pvcName"` -} - -// RetentionType is the enumeration of valid retention policy types. -// +enum -// +kubebuilder:validation:Enum:="RetentionNumber";"RetentionSize" -type RetentionType string - -const ( - // RetentionTypeNumber sets the retention policy based on the number of backup files saved - RetentionTypeNumber RetentionType = "RetentionNumber" - // RetentionTypeSize sets the retention policy based on the total size of the backup files saved - RetentionTypeSize RetentionType = "RetentionSize" -) - -// RetentionPolicy defines the retention policy for retaining and deleting existing backups. -// This struct is a discriminated union that allows users to select the type of retention policy from the supported types. -// +union -type RetentionPolicy struct { - // retentionType sets the type of retention policy. - // Currently, the only valid policies are retention by number of backups (RetentionNumber), by the size of backups (RetentionSize). More policies or types may be added in the future. - // Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. - // The current default is RetentionNumber with 15 backups kept. - // +unionDiscriminator - // +required - RetentionType RetentionType `json:"retentionType"` - - // retentionNumber configures the retention policy based on the number of backups - // +optional - RetentionNumber *RetentionNumberConfig `json:"retentionNumber,omitempty"` - - // retentionSize configures the retention policy based on the size of backups - // +optional - RetentionSize *RetentionSizeConfig `json:"retentionSize,omitempty"` -} - -// RetentionNumberConfig specifies the configuration of the retention policy on the number of backups -type RetentionNumberConfig struct { - // maxNumberOfBackups defines the maximum number of backups to retain. - // If the existing number of backups saved is equal to MaxNumberOfBackups then - // the oldest backup will be removed before a new backup is initiated. - // +kubebuilder:validation:Minimum=1 - // +required - MaxNumberOfBackups int `json:"maxNumberOfBackups"` -} - -// RetentionSizeConfig specifies the configuration of the retention policy on the total size of backups -type RetentionSizeConfig struct { - // maxSizeOfBackupsGb defines the total size in GB of backups to retain. - // If the current total size backups exceeds MaxSizeOfBackupsGb then - // the oldest backup will be removed before a new backup is initiated. - // +kubebuilder:validation:Minimum=1 - // +required - MaxSizeOfBackupsGb int `json:"maxSizeOfBackupsGb"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// BackupList is a collection of items -// -// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. -// +openshift:compatibility-gen:level=4 -type BackupList struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard list's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - metav1.ListMeta `json:"metadata"` - Items []Backup `json:"items"` -} diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go index 12dd0cd312..7c388bef29 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go @@ -138,100 +138,6 @@ func (in *AuthorizationConfig) DeepCopy() *AuthorizationConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Backup) DeepCopyInto(out *Backup) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup. -func (in *Backup) DeepCopy() *Backup { - if in == nil { - return nil - } - out := new(Backup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Backup) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupList) DeepCopyInto(out *BackupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Backup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList. -func (in *BackupList) DeepCopy() *BackupList { - if in == nil { - return nil - } - out := new(BackupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackupList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { - *out = *in - in.EtcdBackupSpec.DeepCopyInto(&out.EtcdBackupSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec. -func (in *BackupSpec) DeepCopy() *BackupSpec { - if in == nil { - return nil - } - out := new(BackupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupStatus) DeepCopyInto(out *BackupStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus. -func (in *BackupStatus) DeepCopy() *BackupStatus { - if in == nil { - return nil - } - out := new(BackupStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { *out = *in @@ -565,23 +471,6 @@ func (in *ECDSAKeyConfig) DeepCopy() *ECDSAKeyConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdBackupSpec) DeepCopyInto(out *EtcdBackupSpec) { - *out = *in - in.RetentionPolicy.DeepCopyInto(&out.RetentionPolicy) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupSpec. -func (in *EtcdBackupSpec) DeepCopy() *EtcdBackupSpec { - if in == nil { - return nil - } - out := new(EtcdBackupSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GatherConfig) DeepCopyInto(out *GatherConfig) { *out = *in @@ -1843,64 +1732,6 @@ func (in *Retention) DeepCopy() *Retention { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionNumberConfig) DeepCopyInto(out *RetentionNumberConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionNumberConfig. -func (in *RetentionNumberConfig) DeepCopy() *RetentionNumberConfig { - if in == nil { - return nil - } - out := new(RetentionNumberConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionPolicy) DeepCopyInto(out *RetentionPolicy) { - *out = *in - if in.RetentionNumber != nil { - in, out := &in.RetentionNumber, &out.RetentionNumber - *out = new(RetentionNumberConfig) - **out = **in - } - if in.RetentionSize != nil { - in, out := &in.RetentionSize, &out.RetentionSize - *out = new(RetentionSizeConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionPolicy. -func (in *RetentionPolicy) DeepCopy() *RetentionPolicy { - if in == nil { - return nil - } - out := new(RetentionPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionSizeConfig) DeepCopyInto(out *RetentionSizeConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionSizeConfig. -func (in *RetentionSizeConfig) DeepCopy() *RetentionSizeConfig { - if in == nil { - return nil - } - out := new(RetentionSizeConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) { *out = *in diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index b2a1241937..c8b9b4ebef 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -1,26 +1,3 @@ -backups.config.openshift.io: - Annotations: {} - ApprovedPRNumber: https://github.com/openshift/api/pull/1482 - CRDName: backups.config.openshift.io - Capability: "" - Category: "" - FeatureGates: - - AutomatedEtcdBackup - FilenameOperatorName: config-operator - FilenameOperatorOrdering: "01" - FilenameRunLevel: "0000_10" - GroupName: config.openshift.io - HasStatus: true - KindName: Backup - Labels: {} - PluralName: backups - PrinterColumns: [] - Scope: Cluster - ShortNames: null - TopLevelFeatureGates: - - AutomatedEtcdBackup - Version: v1alpha1 - criocredentialproviderconfigs.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/2557 diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go index 36a7803bf2..8bf6e52dac 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go @@ -30,26 +30,6 @@ func (in AuthorizationConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.AuthorizationConfig" } -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in Backup) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.Backup" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in BackupList) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.BackupList" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in BackupSpec) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.BackupSpec" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in BackupStatus) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.BackupStatus" -} - // OpenAPIModelName returns the OpenAPI model name for this type. func (in BasicAuth) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.BasicAuth" @@ -125,11 +105,6 @@ func (in ECDSAKeyConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.ECDSAKeyConfig" } -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in EtcdBackupSpec) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.EtcdBackupSpec" -} - // OpenAPIModelName returns the OpenAPI model name for this type. func (in GatherConfig) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.GatherConfig" @@ -400,21 +375,6 @@ func (in Retention) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.Retention" } -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in RetentionNumberConfig) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.RetentionNumberConfig" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in RetentionPolicy) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.RetentionPolicy" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in RetentionSizeConfig) OpenAPIModelName() string { - return "com.github.openshift.api.config.v1alpha1.RetentionSizeConfig" -} - // OpenAPIModelName returns the OpenAPI model name for this type. func (in SecretKeySelector) OpenAPIModelName() string { return "com.github.openshift.api.config.v1alpha1.SecretKeySelector" diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go index 8f6cda1915..fb04a4b543 100644 --- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -11,75 +11,6 @@ package v1alpha1 // Those methods can be generated by using hack/update-swagger-docs.sh // AUTO-GENERATED FUNCTIONS START HERE -var map_Backup = map[string]string{ - "": "\n\nBackup provides configuration for performing backups of the openshift cluster.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "spec holds user settable values for configuration", - "status": "status holds observed values from the cluster. They may not be overridden.", -} - -func (Backup) SwaggerDoc() map[string]string { - return map_Backup -} - -var map_BackupList = map[string]string{ - "": "BackupList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", -} - -func (BackupList) SwaggerDoc() map[string]string { - return map_BackupList -} - -var map_BackupSpec = map[string]string{ - "etcd": "etcd specifies the configuration for periodic backups of the etcd cluster", -} - -func (BackupSpec) SwaggerDoc() map[string]string { - return map_BackupSpec -} - -var map_EtcdBackupSpec = map[string]string{ - "": "EtcdBackupSpec provides configuration for automated etcd backups to the cluster-etcd-operator", - "schedule": "schedule defines the recurring backup schedule in Cron format every 2 hours: 0 */2 * * * every day at 3am: 0 3 * * * Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. The current default is \"no backups\", but will change in the future.", - "timeZone": "The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. See https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones", - "retentionPolicy": "retentionPolicy defines the retention policy for retaining and deleting existing backups.", - "pvcName": "pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup files would be saved The PVC itself must always be created in the \"openshift-etcd\" namespace If the PVC is left unspecified \"\" then the platform will choose a reasonable default location to save the backup. In the future this would be backups saved across the control-plane master nodes.", -} - -func (EtcdBackupSpec) SwaggerDoc() map[string]string { - return map_EtcdBackupSpec -} - -var map_RetentionNumberConfig = map[string]string{ - "": "RetentionNumberConfig specifies the configuration of the retention policy on the number of backups", - "maxNumberOfBackups": "maxNumberOfBackups defines the maximum number of backups to retain. If the existing number of backups saved is equal to MaxNumberOfBackups then the oldest backup will be removed before a new backup is initiated.", -} - -func (RetentionNumberConfig) SwaggerDoc() map[string]string { - return map_RetentionNumberConfig -} - -var map_RetentionPolicy = map[string]string{ - "": "RetentionPolicy defines the retention policy for retaining and deleting existing backups. This struct is a discriminated union that allows users to select the type of retention policy from the supported types.", - "retentionType": "retentionType sets the type of retention policy. Currently, the only valid policies are retention by number of backups (RetentionNumber), by the size of backups (RetentionSize). More policies or types may be added in the future. Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. The current default is RetentionNumber with 15 backups kept.", - "retentionNumber": "retentionNumber configures the retention policy based on the number of backups", - "retentionSize": "retentionSize configures the retention policy based on the size of backups", -} - -func (RetentionPolicy) SwaggerDoc() map[string]string { - return map_RetentionPolicy -} - -var map_RetentionSizeConfig = map[string]string{ - "": "RetentionSizeConfig specifies the configuration of the retention policy on the total size of backups", - "maxSizeOfBackupsGb": "maxSizeOfBackupsGb defines the total size in GB of backups to retain. If the current total size backups exceeds MaxSizeOfBackupsGb then the oldest backup will be removed before a new backup is initiated.", -} - -func (RetentionSizeConfig) SwaggerDoc() map[string]string { - return map_RetentionSizeConfig -} - var map_AdditionalAlertmanagerConfig = map[string]string{ "": "AdditionalAlertmanagerConfig represents configuration for additional Alertmanager instances. The `AdditionalAlertmanagerConfig` resource defines settings for how a component communicates with additional Alertmanager instances.", "name": "name is a unique identifier for this Alertmanager configuration entry. The name must be a valid DNS subdomain (RFC 1123): lowercase alphanumeric characters, hyphens, or periods, and must start and end with an alphanumeric character. Minimum length is 1 character (empty string is invalid). Maximum length is 253 characters.", diff --git a/vendor/github.com/openshift/api/features.md b/vendor/github.com/openshift/api/features.md index a334f3209d..c8104b952d 100644 --- a/vendor/github.com/openshift/api/features.md +++ b/vendor/github.com/openshift/api/features.md @@ -13,6 +13,7 @@ | KarpenterOperator| | | | Enabled | | | | | | MutableTopology| | | | Enabled | | | | | | AuthenticationComponentProxy| | | | Enabled | | | | Enabled | +| BGPBasedVIPManagement| | | Enabled | Enabled | | | | | | ClusterAPIComputeInstall| | | Enabled | Enabled | | | | | | ClusterAPIControlPlaneInstall| | | Enabled | Enabled | | | | | | ClusterUpdatePreflight| | | Enabled | Enabled | | | | | @@ -27,7 +28,6 @@ | NewOLMOwnSingleNamespace| | | | Enabled | | | | Enabled | | NewOLMPreflightPermissionChecks| | | | Enabled | | | | Enabled | | NoRegistryClusterInstall| | | | Enabled | | | | Enabled | -| OLMLifecycleAndCompatibility| | | | Enabled | | | | Enabled | | ProvisioningRequestAvailable| | | Enabled | Enabled | | | | | | AWSClusterHostedDNS| | | Enabled | Enabled | | | Enabled | Enabled | | AWSDedicatedHosts| | | Enabled | Enabled | | | Enabled | Enabled | @@ -84,6 +84,7 @@ | NewOLMWebhookProviderOpenshiftServiceCA| | Enabled | | Enabled | | Enabled | | Enabled | | NoOverlayMode| | | Enabled | Enabled | | | Enabled | Enabled | | NutanixMultiSubnets| | | Enabled | Enabled | | | Enabled | Enabled | +| OLMLifecycleAndCompatibility| | Enabled | | Enabled | | Enabled | | Enabled | | OVNObservability| | | Enabled | Enabled | | | Enabled | Enabled | | OnPremDNSRecords| | | Enabled | Enabled | | | Enabled | Enabled | | SELinuxMount| | | Enabled | Enabled | | | Enabled | Enabled | diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/types.go b/vendor/github.com/openshift/api/machineconfiguration/v1/types.go index 33c12be923..5c4f6804ee 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/types.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/types.go @@ -113,6 +113,19 @@ type ControllerConfigSpec struct { // +required Images map[string]string `json:"images"` + // bgpVIPPeersJSON carries the BGP VIP peer configuration (the config.json + // payload of the bgp-vip-config ConfigMap) for rendering the frr-k8s + // static pod peer file on control plane nodes. Only set when BGP-based + // VIP management is enabled. + // When omitted, BGP-based VIP management is not configured and no + // frr-k8s peer file is rendered. + // When set, the value must be between 1 and 65536 characters long. + // +openshift:enable:FeatureGate=BGPBasedVIPManagement + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=65536 + // +optional + BGPVIPPeersJSON string `json:"bgpVIPPeersJSON,omitempty"` + // baseOSContainerImage is the new-format container image for operating system updates. // +required BaseOSContainerImage string `json:"baseOSContainerImage"` diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml index 6eb9f97c6a..a7866043ce 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml @@ -33,6 +33,7 @@ controllerconfigs.machineconfiguration.openshift.io: - AWSDualStackInstall - AWSEuropeanSovereignCloudInstall - AzureDualStackInstall + - BGPBasedVIPManagement - DualReplica - DyanmicServiceEndpointIBMCloud - MutableTopology diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index aac65c9acb..198c2b9a6d 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -162,6 +162,7 @@ var map_ControllerConfigSpec = map[string]string{ "pullSecret": "pullSecret is the default pull secret that needs to be installed on all machines.", "internalRegistryPullSecret": "internalRegistryPullSecret is the pull secret for the internal registry, used by rpm-ostree to pull images from the internal registry if present", "images": "images is map of images that are used by the controller to render templates under ./templates/", + "bgpVIPPeersJSON": "bgpVIPPeersJSON carries the BGP VIP peer configuration (the config.json payload of the bgp-vip-config ConfigMap) for rendering the frr-k8s static pod peer file on control plane nodes. Only set when BGP-based VIP management is enabled. When omitted, BGP-based VIP management is not configured and no frr-k8s peer file is rendered. When set, the value must be between 1 and 65536 characters long.", "baseOSContainerImage": "baseOSContainerImage is the new-format container image for operating system updates.", "baseOSExtensionsContainerImage": "baseOSExtensionsContainerImage is the matching extensions container for the new-format container", "osImageURL": "osImageURL is the old-format container image that contains the OS update payload.", diff --git a/vendor/github.com/openshift/api/openapi/openapi.json b/vendor/github.com/openshift/api/openapi/openapi.json index 8997a04f85..33b2e6f497 100644 --- a/vendor/github.com/openshift/api/openapi/openapi.json +++ b/vendor/github.com/openshift/api/openapi/openapi.json @@ -5095,6 +5095,14 @@ "nodeDNSIP": { "description": "nodeDNSIP is the IP address for the internal DNS used by the nodes. Unlike the one managed by the DNS operator, `NodeDNSIP` provides name resolution for the nodes themselves. There is no DNS-as-a-service for BareMetal deployments. In order to minimize necessary changes to the datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames to the nodes in the cluster.", "type": "string" + }, + "vipManagement": { + "description": "vipManagement indicates which VIP management mechanism is active on this cluster. Allowed values are `Keepalived`, `BGP`, and omitted. Once set to a non-empty value, this field is immutable. When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are deployed as static pods to advertise VIPs via BGP, replacing the default keepalived/VRRP mechanism. When set to `Keepalived`, the default keepalived-based VIP management is used. When omitted, the default keepalived-based VIP management is used.\n\nPossible enum values:\n - `\"BGP\"` means the VIPs are advertised via BGP by kube-vip (Routing Table Mode) and frr-k8s running as static pods.\n - `\"Keepalived\"` means the VIPs are managed by the default keepalived/VRRP mechanism.", + "type": "string", + "enum": [ + "BGP", + "Keepalived" + ] } } }, @@ -12838,84 +12846,6 @@ } ] }, - "com.github.openshift.api.config.v1alpha1.Backup": { - "description": "Backup provides configuration for performing backups of the openshift cluster.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "type": "object", - "required": [ - "spec" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "default": {}, - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "spec holds user settable values for configuration", - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.BackupSpec" - }, - "status": { - "description": "status holds observed values from the cluster. They may not be overridden.", - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.BackupStatus" - } - } - }, - "com.github.openshift.api.config.v1alpha1.BackupList": { - "description": "BackupList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "type": "object", - "required": [ - "metadata", - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - "type": "string" - }, - "items": { - "type": "array", - "items": { - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.Backup" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "default": {}, - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - } - }, - "com.github.openshift.api.config.v1alpha1.BackupSpec": { - "type": "object", - "required": [ - "etcd" - ], - "properties": { - "etcd": { - "description": "etcd specifies the configuration for periodic backups of the etcd cluster", - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.EtcdBackupSpec" - } - } - }, - "com.github.openshift.api.config.v1alpha1.BackupStatus": { - "type": "object" - }, "com.github.openshift.api.config.v1alpha1.BasicAuth": { "description": "BasicAuth defines basic authentication settings for the remote write endpoint URL.", "type": "object", @@ -13260,32 +13190,6 @@ } } }, - "com.github.openshift.api.config.v1alpha1.EtcdBackupSpec": { - "description": "EtcdBackupSpec provides configuration for automated etcd backups to the cluster-etcd-operator", - "type": "object", - "properties": { - "pvcName": { - "description": "pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup files would be saved The PVC itself must always be created in the \"openshift-etcd\" namespace If the PVC is left unspecified \"\" then the platform will choose a reasonable default location to save the backup. In the future this would be backups saved across the control-plane master nodes.", - "type": "string", - "default": "" - }, - "retentionPolicy": { - "description": "retentionPolicy defines the retention policy for retaining and deleting existing backups.", - "default": {}, - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.RetentionPolicy" - }, - "schedule": { - "description": "schedule defines the recurring backup schedule in Cron format every 2 hours: 0 */2 * * * every day at 3am: 0 3 * * * Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. The current default is \"no backups\", but will change in the future.", - "type": "string", - "default": "" - }, - "timeZone": { - "description": "The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. See https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones", - "type": "string", - "default": "" - } - } - }, "com.github.openshift.api.config.v1alpha1.GatherConfig": { "description": "gatherConfig provides data gathering configuration options.", "type": "object", @@ -14837,71 +14741,6 @@ } } }, - "com.github.openshift.api.config.v1alpha1.RetentionNumberConfig": { - "description": "RetentionNumberConfig specifies the configuration of the retention policy on the number of backups", - "type": "object", - "required": [ - "maxNumberOfBackups" - ], - "properties": { - "maxNumberOfBackups": { - "description": "maxNumberOfBackups defines the maximum number of backups to retain. If the existing number of backups saved is equal to MaxNumberOfBackups then the oldest backup will be removed before a new backup is initiated.", - "type": "integer", - "format": "int32", - "default": 0 - } - } - }, - "com.github.openshift.api.config.v1alpha1.RetentionPolicy": { - "description": "RetentionPolicy defines the retention policy for retaining and deleting existing backups. This struct is a discriminated union that allows users to select the type of retention policy from the supported types.", - "type": "object", - "required": [ - "retentionType" - ], - "properties": { - "retentionNumber": { - "description": "retentionNumber configures the retention policy based on the number of backups", - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.RetentionNumberConfig" - }, - "retentionSize": { - "description": "retentionSize configures the retention policy based on the size of backups", - "$ref": "#/definitions/com.github.openshift.api.config.v1alpha1.RetentionSizeConfig" - }, - "retentionType": { - "description": "retentionType sets the type of retention policy. Currently, the only valid policies are retention by number of backups (RetentionNumber), by the size of backups (RetentionSize). More policies or types may be added in the future. Empty string means no opinion and the platform is left to choose a reasonable default which is subject to change without notice. The current default is RetentionNumber with 15 backups kept.\n\nPossible enum values:\n - `\"RetentionNumber\"` sets the retention policy based on the number of backup files saved\n - `\"RetentionSize\"` sets the retention policy based on the total size of the backup files saved", - "type": "string", - "default": "", - "enum": [ - "RetentionNumber", - "RetentionSize" - ] - } - }, - "x-kubernetes-unions": [ - { - "discriminator": "retentionType", - "fields-to-discriminateBy": { - "retentionNumber": "RetentionNumber", - "retentionSize": "RetentionSize" - } - } - ] - }, - "com.github.openshift.api.config.v1alpha1.RetentionSizeConfig": { - "description": "RetentionSizeConfig specifies the configuration of the retention policy on the total size of backups", - "type": "object", - "required": [ - "maxSizeOfBackupsGb" - ], - "properties": { - "maxSizeOfBackupsGb": { - "description": "maxSizeOfBackupsGb defines the total size in GB of backups to retain. If the current total size backups exceeds MaxSizeOfBackupsGb then the oldest backup will be removed before a new backup is initiated.", - "type": "integer", - "format": "int32", - "default": 0 - } - } - }, "com.github.openshift.api.config.v1alpha1.SecretKeySelector": { "description": "SecretKeySelector selects a key of a Secret in the `openshift-monitoring` namespace.", "type": "object", @@ -37973,26 +37812,6 @@ } } }, - "com.github.openshift.api.operator.v1alpha1.BackupJobReference": { - "description": "BackupJobReference holds a reference to the batch/v1 Job created to run the etcd backup", - "type": "object", - "required": [ - "namespace", - "name" - ], - "properties": { - "name": { - "description": "name is the name of the Job. Required", - "type": "string", - "default": "" - }, - "namespace": { - "description": "namespace is the namespace of the Job. this is always expected to be \"openshift-etcd\" since the user provided PVC is also required to be in \"openshift-etcd\" Required", - "type": "string", - "default": "" - } - } - }, "com.github.openshift.api.operator.v1alpha1.ClusterAPI": { "description": "ClusterAPI provides configuration for the capi-operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "type": "object", @@ -38390,6 +38209,31 @@ } } }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupJob": { + "type": "object", + "required": [ + "name", + "namespace", + "uid" + ], + "properties": { + "name": { + "description": "name of the backup job", + "type": "string", + "default": "" + }, + "namespace": { + "description": "namespace of the backup job", + "type": "string", + "default": "" + }, + "uid": { + "description": "uid of the backup job", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.operator.v1alpha1.EtcdBackupList": { "description": "EtcdBackupList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "type": "object", @@ -38419,23 +38263,179 @@ } } }, - "com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec": { + "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicy": { + "description": "# EtcdBackupPolicy sets an automated schedule for taking backups of the etcd cluster\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "type": "object", + "required": [ + "spec" + ], + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "description": "spec holds user settable values for configuration", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicySpec" + }, + "status": { + "description": "status holds observed values from the cluster. They may not be overridden.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyStatus" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyList": { + "description": "EtcdBackupPolicyList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "type": "object", + "required": [ + "metadata", + "items" + ], "properties": { - "pvcName": { - "description": "pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file would be saved The PVC itself must always be created in the \"openshift-etcd\" namespace If the PVC is left unspecified \"\" then the platform will choose a reasonable default location to save the backup. In the future this would be backups saved across the control-plane master nodes.", + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + "type": "string" + }, + "items": { + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicy" + } + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyRetentionRule": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "maxQuantity": { + "description": "maxQuantity enforces the deletion of backups that exceed the given count.", + "type": "integer", + "format": "int32", + "default": 0 + }, + "maxSize": { + "description": "maxSize enforces the deletion of backups by the total size of backups on the storage backend. This is a soft threshold. The total size of backups may temporarily exceed the limit when new backups are created.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" + }, + "type": { + "description": "type defined which rule field is set", "type": "string", "default": "" } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "maxQuantity": "MaxQuantity", + "maxSize": "MaxSize" + } + } + ] + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicySpec": { + "type": "object", + "required": [ + "schedule", + "storage" + ], + "properties": { + "nodeCount": { + "description": "nodeCount sets the maximum number of nodes to run backups on when multiple are selected. If a value greater than zero is set, nodes are selected in lexicographical order. Values less than or equal to zero will select all available nodes.", + "type": "integer", + "format": "int32" + }, + "nodeSelector": { + "description": "nodeSelector specifies which master node(s) to run backup jobs on. If no selector is specified, the default node-role.kubernetes.io/master label will be used.", + "type": "object", + "additionalProperties": { + "type": "string", + "default": "" + } + }, + "retentionRules": { + "description": "retentionRules defines the policy for retaining and deleting existing backups. Backups are deleted from the oldest first until all rules are satisfied (logical OR). If no rules are specified then backups created by this policy will not be automatically deleted.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyRetentionRule" + } + }, + "schedule": { + "description": "schedule sets the backup schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.", + "type": "string", + "default": "" + }, + "storage": { + "description": "storage specifies the location where etcd backup files will be saved.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage" + }, + "timeZone": { + "description": "The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the cluster-etcd-operator process.", + "type": "string" + } } }, - "com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus": { + "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyStatus": { "type": "object", "properties": { - "backupJob": { - "description": "backupJob is the reference to the Job that executes the backup. Optional", - "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.BackupJobReference" + "lastScheduleNodes": { + "description": "lastScheduleNodes is the name of nodes selected during the last scheduled execution.", + "type": "array", + "items": { + "type": "string", + "default": "" + } }, + "lastScheduleTime": { + "description": "lastScheduleTime is the time when the last scheduled backup was triggered. This is used by the controller to track when backups have been executed and to prevent duplicate executions on controller restart.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec": { + "type": "object", + "required": [ + "storage" + ], + "properties": { + "nodeName": { + "description": "nodeName specifies the master node where an etcd backup should be taken. If not specified, a random master node will be selected.", + "type": "string" + }, + "storage": { + "description": "storage specifies the location where etcd backup files will be saved.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus": { + "type": "object", + "properties": { "conditions": { "description": "conditions provide details on the status of the etcd backup job.", "type": "array", @@ -38447,6 +38447,82 @@ "type" ], "x-kubernetes-list-type": "map" + }, + "filePath": { + "description": "filePath is the absolute path to the backup file on the storage backend.", + "type": "string" + }, + "fileSize": { + "description": "fileSize is the size of the backup file on the storage backend.", + "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" + }, + "job": { + "description": "job is a reference to the Job created for the backup.", + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupJob" + }, + "nodeName": { + "description": "nodeName is the master node where the backup snapshot was taken.", + "type": "string" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "local": { + "description": "local specifies a host path directory on the master node where the etcd backup file will be saved. This field is required when storage type is \"Local\"", + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupStorageLocal" + }, + "pvc": { + "description": "pvc specifies the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file will be saved. The PVC must always be created in the \"openshift-etcd\" namespace. This field is required when the storage type is \"PVC\"", + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.EtcdBackupStoragePvc" + }, + "type": { + "type": "string", + "default": "" + } + }, + "x-kubernetes-unions": [ + { + "discriminator": "type", + "fields-to-discriminateBy": { + "local": "Local", + "pvc": "PVC" + } + } + ] + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupStorageLocal": { + "type": "object", + "required": [ + "hostPath" + ], + "properties": { + "hostPath": { + "description": "hostPath is a local directory on the master node where the etcd backup file will be saved.", + "type": "string", + "default": "" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.EtcdBackupStoragePvc": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "name is a reference to a PVC in the \"openshift-etcd\" namespace where the etcd backup file will be saved.", + "type": "string", + "default": "" + }, + "path": { + "description": "path is a directory on the volume where the etcd backup file will be saved.", + "type": "string", + "default": "" } } }, diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/register.go b/vendor/github.com/openshift/api/operator/v1alpha1/register.go index ec19cba3a9..64b06c36bc 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/register.go +++ b/vendor/github.com/openshift/api/operator/v1alpha1/register.go @@ -39,6 +39,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &OLMList{}, &EtcdBackup{}, &EtcdBackupList{}, + &EtcdBackupPolicy{}, + &EtcdBackupPolicyList{}, &ClusterVersionOperator{}, &ClusterVersionOperatorList{}, &ClusterAPI{}, diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackup.go b/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackup.go index dc5d81cea1..96158505dd 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackup.go +++ b/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackup.go @@ -1,6 +1,7 @@ package v1alpha1 import ( + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -31,52 +32,123 @@ type EtcdBackup struct { } type EtcdBackupSpec struct { - // pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the - // etcd backup file would be saved - // The PVC itself must always be created in the "openshift-etcd" namespace - // If the PVC is left unspecified "" then the platform will choose a reasonable default location to save the backup. - // In the future this would be backups saved across the control-plane master nodes. + // nodeName specifies the master node where an etcd backup should be taken. + // If not specified, a random master node will be selected. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="nodeName is immutable once set" + // +kubebuilder:validation:Optional // +optional - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="pvcName is immutable once set" - PVCName string `json:"pvcName"` + NodeName string `json:"nodeName,omitempty"` + + // storage specifies the location where etcd backup files will be saved. + // +kubebuilder:validation:Required + // +required + Storage EtcdBackupStorage `json:"storage"` +} + +// +kubebuilder:validation:XValidation:rule="self.type == 'PVC' ? has(self.pvc) : !has(self.pvc)",message="pvc is required when type is PVC, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="self.type == 'Local' ? has(self.local) : !has(self.local)",message="local is required when type is Local, and forbidden otherwise" +// +union +type EtcdBackupStorage struct { + // +kubebuilder:validation:Enum:=PVC;Local; + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="type is immutable once set" + // +required + // +unionDiscriminator + Type EtcdBackupStorageType `json:"type"` + + // pvc specifies the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file will be saved. + // The PVC must always be created in the "openshift-etcd" namespace. + // This field is required when the storage type is "PVC" + // +kubebuilder:validation:Optional + // +optional + // +unionMember + PVC *EtcdBackupStoragePvc `json:"pvc,omitempty"` + + // local specifies a host path directory on the master node where the etcd backup file will be saved. + // This field is required when storage type is "Local" + // +kubebuilder:validation:Optional + // +optional + // +unionMember + Local *EtcdBackupStorageLocal `json:"local,omitempty"` +} + +// EtcdBackupStorageType is an enum of the supported storage backends for backup files +type EtcdBackupStorageType string + +const ( + EtcdBackupStorageTypePVC EtcdBackupStorageType = "PVC" + EtcdBackupStorageTypeLocal EtcdBackupStorageType = "Local" +) + +type EtcdBackupStoragePvc struct { + // name is a reference to a PVC in the "openshift-etcd" namespace where the etcd backup file will be saved. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable once set" + // +kubebuilder:validation:Required + // +required + Name string `json:"name"` + + // path is a directory on the volume where the etcd backup file will be saved. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="path is immutable once set" + // +kubebuilder:validation:Optional + // +optional + Path string `json:"path"` +} + +type EtcdBackupStorageLocal struct { + // hostPath is a local directory on the master node where the etcd backup file will be saved. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="hostPath is immutable once set" + // +kubebuilder:validation:Required + // +required + HostPath string `json:"hostPath"` } type EtcdBackupStatus struct { // conditions provide details on the status of the etcd backup job. + // +kubebuilder:validation:Optional // +listType=map // +listMapKey=type // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` + Conditions []metav1.Condition `json:"conditions"` - // backupJob is the reference to the Job that executes the backup. - // Optional + // job is a reference to the Job created for the backup. + // +kubebuilder:validation:Optional // +optional - BackupJob *BackupJobReference `json:"backupJob"` -} + Job *EtcdBackupJob `json:"job,omitempty"` -// BackupJobReference holds a reference to the batch/v1 Job created to run the etcd backup -type BackupJobReference struct { + // nodeName is the master node where the backup snapshot was taken. + // +kubebuilder:validation:Optional + // +optional + NodeName string `json:"nodeName,omitempty"` - // namespace is the namespace of the Job. - // this is always expected to be "openshift-etcd" since the user provided PVC - // is also required to be in "openshift-etcd" - // Required - // +required - // +kubebuilder:validation:Pattern:=`^openshift-etcd$` - Namespace string `json:"namespace"` + // filePath is the absolute path to the backup file on the storage backend. + // +kubebuilder:validation:Optional + // +optional + FilePath string `json:"filePath,omitempty"` + + // fileSize is the size of the backup file on the storage backend. + // +kubebuilder:validation:Optional + // +optional + FileSize resource.Quantity `json:"fileSize,omitempty"` +} - // name is the name of the Job. - // Required +type EtcdBackupJob struct { + // name of the backup job + // +kubebuilder:validation:Required // +required Name string `json:"name"` + // namespace of the backup job + // +kubebuilder:validation:Required + // +required + Namespace string `json:"namespace"` + // uid of the backup job + // +kubebuilder:validation:Required + // +required + UID string `json:"uid"` } type BackupConditionReason string var ( - // BackupPending is added to the EtcdBackupStatus Conditions when the etcd backup is pending. - BackupPending BackupConditionReason = "BackupPending" - // BackupCompleted is added to the EtcdBackupStatus Conditions when the etcd backup has completed. BackupCompleted BackupConditionReason = "BackupCompleted" diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackuppolicy.go b/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackuppolicy.go new file mode 100644 index 0000000000..a128ccf21a --- /dev/null +++ b/vendor/github.com/openshift/api/operator/v1alpha1/types_etcdbackuppolicy.go @@ -0,0 +1,126 @@ +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +// # EtcdBackupPolicy sets an automated schedule for taking backups of the etcd cluster +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=etcdbackuppolicies,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io= +// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=etcd,operatorOrdering=01 +// +openshift:enable:FeatureGate=AutomatedEtcdBackup +type EtcdBackupPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + // +required + Spec EtcdBackupPolicySpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + // +optional + Status EtcdBackupPolicyStatus `json:"status"` +} + +type EtcdBackupPolicySpec struct { + // schedule sets the backup schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. + // +kubebuilder:validation:Required + // +required + Schedule string `json:"schedule"` + + // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. + // If not specified, this will default to the time zone of the cluster-etcd-operator process. + // +kubebuilder:validation:Optional + // +optional + TimeZone string `json:"timeZone,omitempty"` + + // nodeSelector specifies which master node(s) to run backup jobs on. + // If no selector is specified, the default node-role.kubernetes.io/master label will be used. + // +kubebuilder:validation:Optional + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // nodeCount sets the maximum number of nodes to run backups on when multiple are selected. + // If a value greater than zero is set, nodes are selected in lexicographical order. + // Values less than or equal to zero will select all available nodes. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Optional + // +optional + NodeCount int `json:"nodeCount,omitempty"` + + // storage specifies the location where etcd backup files will be saved. + // +kubebuilder:validation:Required + // +required + Storage EtcdBackupStorage `json:"storage"` + + // retentionRules defines the policy for retaining and deleting existing backups. + // Backups are deleted from the oldest first until all rules are satisfied (logical OR). + // If no rules are specified then backups created by this policy will not be automatically deleted. + // +kubebuilder:validation:Optional + // +optional + RetentionRules []EtcdBackupPolicyRetentionRule `json:"retentionRules,omitzero"` +} + +// +union +type EtcdBackupPolicyRetentionRule struct { + // type defined which rule field is set + // +unionDiscriminator + // +kubebuilder:validation:Enum:=MaxQuantity;MaxSize + // +kubebuilder:validation:Required + // +required + Type EtcdBackupPolicyRetentionRuleType `json:"type"` + + // maxQuantity enforces the deletion of backups that exceed the given count. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Optional + // +optional + MaxQuantity int `json:"maxQuantity,omitzero"` + + // maxSize enforces the deletion of backups by the total size of backups on the storage backend. + // This is a soft threshold. The total size of backups may temporarily exceed the limit when new backups are created. + // +kubebuilder:validation:Optional + // +optional + MaxSize resource.Quantity `json:"maxSize,omitzero"` +} + +type EtcdBackupPolicyRetentionRuleType string + +const ( + EtcdBackupPolicyRetentionRuleMaxQuantity EtcdBackupPolicyRetentionRuleType = "MaxQuantity" + EtcdBackupPolicyRetentionRuleMaxSize EtcdBackupPolicyRetentionRuleType = "MaxSize" +) + +type EtcdBackupPolicyStatus struct { + // lastScheduleTime is the time when the last scheduled backup was triggered. + // This is used by the controller to track when backups have been executed + // and to prevent duplicate executions on controller restart. + // +kubebuilder:validation:Optional + // +optional + LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` + + // lastScheduleNodes is the name of nodes selected during the last scheduled execution. + // +kubebuilder:validation:Optional + // +optional + LastScheduleNodes []string `json:"lastScheduleNodes,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EtcdBackupPolicyList is a collection of items +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 +type EtcdBackupPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []EtcdBackupPolicy `json:"items"` +} diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.deepcopy.go index 3c3dc8e7a5..1fe8fdc1a5 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.deepcopy.go @@ -10,22 +10,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupJobReference) DeepCopyInto(out *BackupJobReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupJobReference. -func (in *BackupJobReference) DeepCopy() *BackupJobReference { - if in == nil { - return nil - } - out := new(BackupJobReference) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterAPI) DeepCopyInto(out *ClusterAPI) { *out = *in @@ -369,7 +353,7 @@ func (in *EtcdBackup) DeepCopyInto(out *EtcdBackup) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return } @@ -392,6 +376,22 @@ func (in *EtcdBackup) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupJob) DeepCopyInto(out *EtcdBackupJob) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupJob. +func (in *EtcdBackupJob) DeepCopy() *EtcdBackupJob { + if in == nil { + return nil + } + out := new(EtcdBackupJob) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EtcdBackupList) DeepCopyInto(out *EtcdBackupList) { *out = *in @@ -425,9 +425,144 @@ func (in *EtcdBackupList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupPolicy) DeepCopyInto(out *EtcdBackupPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupPolicy. +func (in *EtcdBackupPolicy) DeepCopy() *EtcdBackupPolicy { + if in == nil { + return nil + } + out := new(EtcdBackupPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EtcdBackupPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupPolicyList) DeepCopyInto(out *EtcdBackupPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EtcdBackupPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupPolicyList. +func (in *EtcdBackupPolicyList) DeepCopy() *EtcdBackupPolicyList { + if in == nil { + return nil + } + out := new(EtcdBackupPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EtcdBackupPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupPolicyRetentionRule) DeepCopyInto(out *EtcdBackupPolicyRetentionRule) { + *out = *in + out.MaxSize = in.MaxSize.DeepCopy() + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupPolicyRetentionRule. +func (in *EtcdBackupPolicyRetentionRule) DeepCopy() *EtcdBackupPolicyRetentionRule { + if in == nil { + return nil + } + out := new(EtcdBackupPolicyRetentionRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupPolicySpec) DeepCopyInto(out *EtcdBackupPolicySpec) { + *out = *in + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.Storage.DeepCopyInto(&out.Storage) + if in.RetentionRules != nil { + in, out := &in.RetentionRules, &out.RetentionRules + *out = make([]EtcdBackupPolicyRetentionRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupPolicySpec. +func (in *EtcdBackupPolicySpec) DeepCopy() *EtcdBackupPolicySpec { + if in == nil { + return nil + } + out := new(EtcdBackupPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupPolicyStatus) DeepCopyInto(out *EtcdBackupPolicyStatus) { + *out = *in + if in.LastScheduleTime != nil { + in, out := &in.LastScheduleTime, &out.LastScheduleTime + *out = (*in).DeepCopy() + } + if in.LastScheduleNodes != nil { + in, out := &in.LastScheduleNodes, &out.LastScheduleNodes + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupPolicyStatus. +func (in *EtcdBackupPolicyStatus) DeepCopy() *EtcdBackupPolicyStatus { + if in == nil { + return nil + } + out := new(EtcdBackupPolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EtcdBackupSpec) DeepCopyInto(out *EtcdBackupSpec) { *out = *in + in.Storage.DeepCopyInto(&out.Storage) return } @@ -451,11 +586,12 @@ func (in *EtcdBackupStatus) DeepCopyInto(out *EtcdBackupStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.BackupJob != nil { - in, out := &in.BackupJob, &out.BackupJob - *out = new(BackupJobReference) + if in.Job != nil { + in, out := &in.Job, &out.Job + *out = new(EtcdBackupJob) **out = **in } + out.FileSize = in.FileSize.DeepCopy() return } @@ -469,6 +605,64 @@ func (in *EtcdBackupStatus) DeepCopy() *EtcdBackupStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupStorage) DeepCopyInto(out *EtcdBackupStorage) { + *out = *in + if in.PVC != nil { + in, out := &in.PVC, &out.PVC + *out = new(EtcdBackupStoragePvc) + **out = **in + } + if in.Local != nil { + in, out := &in.Local, &out.Local + *out = new(EtcdBackupStorageLocal) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupStorage. +func (in *EtcdBackupStorage) DeepCopy() *EtcdBackupStorage { + if in == nil { + return nil + } + out := new(EtcdBackupStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupStorageLocal) DeepCopyInto(out *EtcdBackupStorageLocal) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupStorageLocal. +func (in *EtcdBackupStorageLocal) DeepCopy() *EtcdBackupStorageLocal { + if in == nil { + return nil + } + out := new(EtcdBackupStorageLocal) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdBackupStoragePvc) DeepCopyInto(out *EtcdBackupStoragePvc) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdBackupStoragePvc. +func (in *EtcdBackupStoragePvc) DeepCopy() *EtcdBackupStoragePvc { + if in == nil { + return nil + } + out := new(EtcdBackupStoragePvc) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GenerationHistory) DeepCopyInto(out *GenerationHistory) { *out = *in diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index 3ad442d9d8..ca4e2bcc8e 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -68,6 +68,29 @@ etcdbackups.operator.openshift.io: - AutomatedEtcdBackup Version: v1alpha1 +etcdbackuppolicies.operator.openshift.io: + Annotations: {} + ApprovedPRNumber: "" + CRDName: etcdbackuppolicies.operator.openshift.io + Capability: "" + Category: "" + FeatureGates: + - AutomatedEtcdBackup + FilenameOperatorName: etcd + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_10" + GroupName: operator.openshift.io + HasStatus: true + KindName: EtcdBackupPolicy + Labels: {} + PluralName: etcdbackuppolicies + PrinterColumns: [] + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - AutomatedEtcdBackup + Version: v1alpha1 + imagecontentsourcepolicies.operator.openshift.io: Annotations: release.openshift.io/bootstrap-required: "true" diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go index e3fe9897dd..7b63d88b25 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go +++ b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go @@ -5,11 +5,6 @@ package v1alpha1 -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in BackupJobReference) OpenAPIModelName() string { - return "com.github.openshift.api.operator.v1alpha1.BackupJobReference" -} - // OpenAPIModelName returns the OpenAPI model name for this type. func (in ClusterAPI) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.ClusterAPI" @@ -90,11 +85,41 @@ func (in EtcdBackup) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.EtcdBackup" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupJob) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupJob" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in EtcdBackupList) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.EtcdBackupList" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupPolicyList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupPolicyRetentionRule) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyRetentionRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupPolicySpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupPolicyStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupPolicyStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in EtcdBackupSpec) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec" @@ -105,6 +130,21 @@ func (in EtcdBackupStatus) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupStorage) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupStorage" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupStorageLocal) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupStorageLocal" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdBackupStoragePvc) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1alpha1.EtcdBackupStoragePvc" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in GenerationHistory) OpenAPIModelName() string { return "com.github.openshift.api.operator.v1alpha1.GenerationHistory" diff --git a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.swagger_doc_generated.go index bf4117768d..f169a78942 100644 --- a/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.swagger_doc_generated.go @@ -268,16 +268,6 @@ func (ClusterVersionOperatorStatus) SwaggerDoc() map[string]string { return map_ClusterVersionOperatorStatus } -var map_BackupJobReference = map[string]string{ - "": "BackupJobReference holds a reference to the batch/v1 Job created to run the etcd backup", - "namespace": "namespace is the namespace of the Job. this is always expected to be \"openshift-etcd\" since the user provided PVC is also required to be in \"openshift-etcd\" Required", - "name": "name is the name of the Job. Required", -} - -func (BackupJobReference) SwaggerDoc() map[string]string { - return map_BackupJobReference -} - var map_EtcdBackup = map[string]string{ "": "\n\n# EtcdBackup provides configuration options and status for a one-time backup attempt of the etcd cluster\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "spec": "spec holds user settable values for configuration", @@ -288,6 +278,16 @@ func (EtcdBackup) SwaggerDoc() map[string]string { return map_EtcdBackup } +var map_EtcdBackupJob = map[string]string{ + "name": "name of the backup job", + "namespace": "namespace of the backup job", + "uid": "uid of the backup job", +} + +func (EtcdBackupJob) SwaggerDoc() map[string]string { + return map_EtcdBackupJob +} + var map_EtcdBackupList = map[string]string{ "": "EtcdBackupList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", } @@ -297,7 +297,8 @@ func (EtcdBackupList) SwaggerDoc() map[string]string { } var map_EtcdBackupSpec = map[string]string{ - "pvcName": "pvcName specifies the name of the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file would be saved The PVC itself must always be created in the \"openshift-etcd\" namespace If the PVC is left unspecified \"\" then the platform will choose a reasonable default location to save the backup. In the future this would be backups saved across the control-plane master nodes.", + "nodeName": "nodeName specifies the master node where an etcd backup should be taken. If not specified, a random master node will be selected.", + "storage": "storage specifies the location where etcd backup files will be saved.", } func (EtcdBackupSpec) SwaggerDoc() map[string]string { @@ -306,13 +307,92 @@ func (EtcdBackupSpec) SwaggerDoc() map[string]string { var map_EtcdBackupStatus = map[string]string{ "conditions": "conditions provide details on the status of the etcd backup job.", - "backupJob": "backupJob is the reference to the Job that executes the backup. Optional", + "job": "job is a reference to the Job created for the backup.", + "nodeName": "nodeName is the master node where the backup snapshot was taken.", + "filePath": "filePath is the absolute path to the backup file on the storage backend.", + "fileSize": "fileSize is the size of the backup file on the storage backend.", } func (EtcdBackupStatus) SwaggerDoc() map[string]string { return map_EtcdBackupStatus } +var map_EtcdBackupStorage = map[string]string{ + "pvc": "pvc specifies the PersistentVolumeClaim (PVC) which binds a PersistentVolume where the etcd backup file will be saved. The PVC must always be created in the \"openshift-etcd\" namespace. This field is required when the storage type is \"PVC\"", + "local": "local specifies a host path directory on the master node where the etcd backup file will be saved. This field is required when storage type is \"Local\"", +} + +func (EtcdBackupStorage) SwaggerDoc() map[string]string { + return map_EtcdBackupStorage +} + +var map_EtcdBackupStorageLocal = map[string]string{ + "hostPath": "hostPath is a local directory on the master node where the etcd backup file will be saved.", +} + +func (EtcdBackupStorageLocal) SwaggerDoc() map[string]string { + return map_EtcdBackupStorageLocal +} + +var map_EtcdBackupStoragePvc = map[string]string{ + "name": "name is a reference to a PVC in the \"openshift-etcd\" namespace where the etcd backup file will be saved.", + "path": "path is a directory on the volume where the etcd backup file will be saved.", +} + +func (EtcdBackupStoragePvc) SwaggerDoc() map[string]string { + return map_EtcdBackupStoragePvc +} + +var map_EtcdBackupPolicy = map[string]string{ + "": "\n\n# EtcdBackupPolicy sets an automated schedule for taking backups of the etcd cluster\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "spec": "spec holds user settable values for configuration", + "status": "status holds observed values from the cluster. They may not be overridden.", +} + +func (EtcdBackupPolicy) SwaggerDoc() map[string]string { + return map_EtcdBackupPolicy +} + +var map_EtcdBackupPolicyList = map[string]string{ + "": "EtcdBackupPolicyList is a collection of items\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", +} + +func (EtcdBackupPolicyList) SwaggerDoc() map[string]string { + return map_EtcdBackupPolicyList +} + +var map_EtcdBackupPolicyRetentionRule = map[string]string{ + "type": "type defined which rule field is set", + "maxQuantity": "maxQuantity enforces the deletion of backups that exceed the given count.", + "maxSize": "maxSize enforces the deletion of backups by the total size of backups on the storage backend. This is a soft threshold. The total size of backups may temporarily exceed the limit when new backups are created.", +} + +func (EtcdBackupPolicyRetentionRule) SwaggerDoc() map[string]string { + return map_EtcdBackupPolicyRetentionRule +} + +var map_EtcdBackupPolicySpec = map[string]string{ + "schedule": "schedule sets the backup schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.", + "timeZone": "The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the cluster-etcd-operator process.", + "nodeSelector": "nodeSelector specifies which master node(s) to run backup jobs on. If no selector is specified, the default node-role.kubernetes.io/master label will be used.", + "nodeCount": "nodeCount sets the maximum number of nodes to run backups on when multiple are selected. If a value greater than zero is set, nodes are selected in lexicographical order. Values less than or equal to zero will select all available nodes.", + "storage": "storage specifies the location where etcd backup files will be saved.", + "retentionRules": "retentionRules defines the policy for retaining and deleting existing backups. Backups are deleted from the oldest first until all rules are satisfied (logical OR). If no rules are specified then backups created by this policy will not be automatically deleted.", +} + +func (EtcdBackupPolicySpec) SwaggerDoc() map[string]string { + return map_EtcdBackupPolicySpec +} + +var map_EtcdBackupPolicyStatus = map[string]string{ + "lastScheduleTime": "lastScheduleTime is the time when the last scheduled backup was triggered. This is used by the controller to track when backups have been executed and to prevent duplicate executions on controller restart.", + "lastScheduleNodes": "lastScheduleNodes is the name of nodes selected during the last scheduled execution.", +} + +func (EtcdBackupPolicyStatus) SwaggerDoc() map[string]string { + return map_EtcdBackupPolicyStatus +} + var map_ImageContentSourcePolicy = map[string]string{ "": "ImageContentSourcePolicy holds cluster-wide information about how to handle registry mirror rules. When multiple policies are defined, the outcome of the behavior is defined on each field.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", diff --git a/vendor/modules.txt b/vendor/modules.txt index 4e5a034ac4..7ab61233e4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -79,7 +79,7 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/openshift/api v0.0.0-20260723163829-0f2bcae5eb15 +# github.com/openshift/api v0.0.0-20260723163829-0f2bcae5eb15 => github.com/bhperry/openshift-api v0.0.0-20260727162810-8887fbaa588a ## explicit; go 1.26.0 github.com/openshift/api github.com/openshift/api/apiextensions @@ -557,3 +557,4 @@ sigs.k8s.io/structured-merge-diff/v6/value # sigs.k8s.io/yaml v1.6.0 ## explicit; go 1.22 sigs.k8s.io/yaml +# github.com/openshift/api => github.com/bhperry/openshift-api v0.0.0-20260727162810-8887fbaa588a