Skip to content

Commit

Permalink
Remove spec.upgrade field and Upgrade ops type
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 1, 2023
1 parent e50ab23 commit c6d66f7
Show file tree
Hide file tree
Showing 37 changed files with 7 additions and 333 deletions.
15 changes: 0 additions & 15 deletions apis/ops/v1alpha1/elasticsearch_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ func (e *ElasticsearchOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return e.ObjectMeta
}

func (e ElasticsearchOpsRequest) GetRequestType() any {
switch e.Spec.Type {
case ElasticsearchOpsRequestTypeUpgrade:
return ElasticsearchOpsRequestTypeUpdateVersion
}
return e.Spec.Type
}

func (e ElasticsearchOpsRequest) GetUpdateVersionSpec() *ElasticsearchUpdateVersionSpec {
if e.Spec.UpdateVersion != nil {
return e.Spec.UpdateVersion
}
return e.Spec.Upgrade
}

func (e *ElasticsearchOpsRequest) GetDBRefName() string {
return e.Spec.DatabaseRef.Name
}
Expand Down
5 changes: 1 addition & 4 deletions apis/ops/v1alpha1/elasticsearch_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type ElasticsearchOpsRequestSpec struct {
Type ElasticsearchOpsRequestType `json:"type"`
// Specifies information necessary for upgrading Elasticsearch
UpdateVersion *ElasticsearchUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for upgrading Elasticsearch
// Deprecated: use UpdateVersion
Upgrade *ElasticsearchUpdateVersionSpec `json:"upgrade,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *ElasticsearchHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
Expand All @@ -80,7 +77,7 @@ type ElasticsearchOpsRequestSpec struct {
}

// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS
// ENUM(Upgrade, UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
type ElasticsearchOpsRequestType string

// ElasticsearchReplicaReadinessCriteria is the criteria for checking readiness of an Elasticsearch database
Expand Down
5 changes: 0 additions & 5 deletions apis/ops/v1alpha1/elasticsearch_ops_types_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions apis/ops/v1alpha1/etcd_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ func (e *EtcdOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return e.ObjectMeta
}

func (e EtcdOpsRequest) GetRequestType() any {
return e.Spec.Type
}

func (e EtcdOpsRequest) GetUpdateVersionSpec() *EtcdUpdateVersionSpec {
return e.Spec.UpdateVersion
}

func (e *EtcdOpsRequest) GetDBRefName() string {
return e.Spec.DatabaseRef.Name
}
Expand Down
8 changes: 0 additions & 8 deletions apis/ops/v1alpha1/kafka_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,10 @@ func (k *KafkaOpsRequest) ResourcePlural() string {

var _ Accessor = &KafkaOpsRequest{}

func (k *KafkaOpsRequest) GetRequestType() any {
return k.Spec.Type
}

func (k *KafkaOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return k.ObjectMeta
}

func (k *KafkaOpsRequest) GetUpdateVersionSpec() *KafkaUpdateVersionSpec {
return k.Spec.UpdateVersion
}

func (k *KafkaOpsRequest) GetDBRefName() string {
return k.Spec.DatabaseRef.Name
}
Expand Down
15 changes: 0 additions & 15 deletions apis/ops/v1alpha1/mariadb_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,6 @@ func (m *MariaDBOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return m.ObjectMeta
}

func (m MariaDBOpsRequest) GetRequestType() any {
switch m.Spec.Type {
case MariaDBOpsRequestTypeUpgrade:
return MariaDBOpsRequestTypeUpdateVersion
}
return m.Spec.Type
}

func (m MariaDBOpsRequest) GetUpdateVersionSpec() *MariaDBUpdateVersionSpec {
if m.Spec.UpdateVersion != nil {
return m.Spec.UpdateVersion
}
return m.Spec.Upgrade
}

func (m *MariaDBOpsRequest) GetDBRefName() string {
return m.Spec.DatabaseRef.Name
}
Expand Down
5 changes: 1 addition & 4 deletions apis/ops/v1alpha1/mariadb_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type MariaDBOpsRequestSpec struct {
Type MariaDBOpsRequestType `json:"type"`
// Specifies information necessary for upgrading MariaDB
UpdateVersion *MariaDBUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for upgrading MariaDB
// Deprecated: use UpdateVersion
Upgrade *MariaDBUpdateVersionSpec `json:"upgrade,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *MariaDBHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
Expand All @@ -80,7 +77,7 @@ type MariaDBOpsRequestSpec struct {
}

// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS
// ENUM(Upgrade, UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
type MariaDBOpsRequestType string

// MariaDBReplicaReadinessCriteria is the criteria for checking readiness of an MariaDB database
Expand Down
5 changes: 0 additions & 5 deletions apis/ops/v1alpha1/mariadb_ops_types_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions apis/ops/v1alpha1/memcached_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ func (m *MemcachedOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return m.ObjectMeta
}

func (m MemcachedOpsRequest) GetRequestType() any {
switch m.Spec.Type {
case MemcachedOpsRequestTypeUpgrade:
return MemcachedOpsRequestTypeUpdateVersion
}
return m.Spec.Type
}

func (m MemcachedOpsRequest) GetUpdateVersionSpec() *MemcachedUpdateVersionSpec {
if m.Spec.UpdateVersion != nil {
return m.Spec.UpdateVersion
}
return m.Spec.Upgrade
}

func (m *MemcachedOpsRequest) GetDBRefName() string {
return m.Spec.DatabaseRef.Name
}
Expand Down
5 changes: 1 addition & 4 deletions apis/ops/v1alpha1/memcached_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ type MemcachedOpsRequestSpec struct {
Type MemcachedOpsRequestType `json:"type"`
// Specifies information necessary for upgrading Memcached
UpdateVersion *MemcachedUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for upgrading Memcached
// Deprecated: use UpdateVersion
Upgrade *MemcachedUpdateVersionSpec `json:"upgrade,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *MemcachedHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
Expand All @@ -77,7 +74,7 @@ type MemcachedOpsRequestSpec struct {
}

// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS
// ENUM(Upgrade, UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
type MemcachedOpsRequestType string

// MemcachedReplicaReadinessCriteria is the criteria for checking readiness of a Memcached pod
Expand Down
5 changes: 0 additions & 5 deletions apis/ops/v1alpha1/memcached_ops_types_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions apis/ops/v1alpha1/mongodb_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@ func (m *MongoDBOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return m.ObjectMeta
}

func (m MongoDBOpsRequest) GetRequestType() any {
switch m.Spec.Type {
case MongoDBOpsRequestTypeUpgrade:
return MongoDBOpsRequestTypeUpdateVersion
}
return m.Spec.Type
}

func (m MongoDBOpsRequest) GetUpdateVersionSpec() *MongoDBUpdateVersionSpec {
if m.Spec.UpdateVersion != nil {
return m.Spec.UpdateVersion
}
return m.Spec.Upgrade
}

func (m *MongoDBOpsRequest) GetDBRefName() string {
return m.Spec.DatabaseRef.Name
}
Expand Down
5 changes: 1 addition & 4 deletions apis/ops/v1alpha1/mongodb_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type MongoDBOpsRequestSpec struct {
Type MongoDBOpsRequestType `json:"type"`
// Specifies information necessary for upgrading MongoDB
UpdateVersion *MongoDBUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for upgrading MongoDB
// Deprecated: use UpdateVersion
Upgrade *MongoDBUpdateVersionSpec `json:"upgrade,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *MongoDBHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
Expand All @@ -85,7 +82,7 @@ type MongoDBOpsRequestSpec struct {
}

// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS;Reprovision
// ENUM(Upgrade, UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS, Reprovision)
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS, Reprovision)
type MongoDBOpsRequestType string

// MongoDBReplicaReadinessCriteria is the criteria for checking readiness of a MongoDB pod
Expand Down
5 changes: 0 additions & 5 deletions apis/ops/v1alpha1/mongodb_ops_types_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions apis/ops/v1alpha1/mysql_ops_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,6 @@ func (m *MySQLOpsRequest) GetObjectMeta() metav1.ObjectMeta {
return m.ObjectMeta
}

func (m MySQLOpsRequest) GetRequestType() any {
switch m.Spec.Type {
case MySQLOpsRequestTypeUpgrade:
return MySQLOpsRequestTypeUpdateVersion
}
return m.Spec.Type
}

func (m MySQLOpsRequest) GetUpdateVersionSpec() *MySQLUpdateVersionSpec {
if m.Spec.UpdateVersion != nil {
return m.Spec.UpdateVersion
}
return m.Spec.Upgrade
}

func (m *MySQLOpsRequest) GetDBRefName() string {
return m.Spec.DatabaseRef.Name
}
Expand Down
5 changes: 1 addition & 4 deletions apis/ops/v1alpha1/mysql_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type MySQLOpsRequestSpec struct {
Type MySQLOpsRequestType `json:"type"`
// Specifies information necessary for upgrading MySQL
UpdateVersion *MySQLUpdateVersionSpec `json:"updateVersion,omitempty"`
// Specifies information necessary for upgrading MySQL
// Deprecated: use UpdateVersion
Upgrade *MySQLUpdateVersionSpec `json:"upgrade,omitempty"`
// Specifies information necessary for horizontal scaling
HorizontalScaling *MySQLHorizontalScalingSpec `json:"horizontalScaling,omitempty"`
// Specifies information necessary for vertical scaling
Expand All @@ -80,7 +77,7 @@ type MySQLOpsRequestSpec struct {
}

// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS
// ENUM(Upgrade, UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS)
type MySQLOpsRequestType string

// MySQLReplicaReadinessCriteria is the criteria for checking readiness of a MySQL pod
Expand Down
Loading

0 comments on commit c6d66f7

Please sign in to comment.