Skip to content

Commit

Permalink
Remove spec.updateStrategy field (#577)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Sep 2, 2020
1 parent dfd1195 commit 7075b38
Show file tree
Hide file tree
Showing 42 changed files with 484 additions and 1,379 deletions.
4 changes: 0 additions & 4 deletions apis/kubedb/v1alpha1/etcd_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"kubedb.dev/apimachinery/crds"

"github.com/appscode/go/types"
apps "k8s.io/api/apps/v1"
"kmodules.xyz/client-go/apiextensions"
meta_util "kmodules.xyz/client-go/meta"
appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
Expand Down Expand Up @@ -155,9 +154,6 @@ func (e *Etcd) SetDefaults() {
if e.Spec.StorageType == "" {
e.Spec.StorageType = StorageTypeDurable
}
if e.Spec.UpdateStrategy.Type == "" {
e.Spec.UpdateStrategy.Type = apps.RollingUpdateStatefulSetStrategyType
}
if e.Spec.TerminationPolicy == "" {
e.Spec.TerminationPolicy = TerminationPolicyDelete
} else if e.Spec.TerminationPolicy == TerminationPolicyPause {
Expand Down
12 changes: 3 additions & 9 deletions apis/kubedb/v1alpha1/etcd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1alpha1

import (
apps "k8s.io/api/apps/v1"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
mona "kmodules.xyz/monitoring-agent-api/api/v1"
Expand Down Expand Up @@ -85,22 +84,17 @@ type EtcdSpec struct {
// +optional
ServiceTemplate ofst.ServiceTemplateSpec `json:"serviceTemplate,omitempty" protobuf:"bytes,11,opt,name=serviceTemplate"`

// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
UpdateStrategy apps.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,12,opt,name=updateStrategy"`

// Indicates that the database is paused and controller will not sync any changes made to this spec.
// +optional
Paused bool `json:"paused,omitempty" protobuf:"varint,13,opt,name=paused"`
Paused bool `json:"paused,omitempty" protobuf:"varint,12,opt,name=paused"`

// Indicates that the database is halted and all offshoot Kubernetes resources except PVCs are deleted.
// +optional
Halted bool `json:"halted,omitempty" protobuf:"varint,14,opt,name=halted"`
Halted bool `json:"halted,omitempty" protobuf:"varint,13,opt,name=halted"`

// TerminationPolicy controls the delete operation for database
// +optional
TerminationPolicy TerminationPolicy `json:"terminationPolicy,omitempty" protobuf:"bytes,15,opt,name=terminationPolicy,casttype=TerminationPolicy"`
TerminationPolicy TerminationPolicy `json:"terminationPolicy,omitempty" protobuf:"bytes,14,opt,name=terminationPolicy,casttype=TerminationPolicy"`
}

type TLSPolicy struct {
Expand Down
1,173 changes: 373 additions & 800 deletions apis/kubedb/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

110 changes: 33 additions & 77 deletions apis/kubedb/v1alpha1/generated.proto

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

4 changes: 0 additions & 4 deletions apis/kubedb/v1alpha1/mariadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"kubedb.dev/apimachinery/crds"

"github.com/appscode/go/types"
apps "k8s.io/api/apps/v1"
"kmodules.xyz/client-go/apiextensions"
meta_util "kmodules.xyz/client-go/meta"
appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
Expand Down Expand Up @@ -156,9 +155,6 @@ func (m *MariaDB) SetDefaults() {
if m.Spec.StorageType == "" {
m.Spec.StorageType = StorageTypeDurable
}
if m.Spec.UpdateStrategy.Type == "" {
m.Spec.UpdateStrategy.Type = apps.RollingUpdateStatefulSetStrategyType
}
if m.Spec.TerminationPolicy == "" {
m.Spec.TerminationPolicy = TerminationPolicyDelete
} else if m.Spec.TerminationPolicy == TerminationPolicyPause {
Expand Down
8 changes: 1 addition & 7 deletions apis/kubedb/v1alpha1/mariadb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1alpha1

import (
apps "k8s.io/api/apps/v1"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
Expand Down Expand Up @@ -87,14 +86,9 @@ type MariaDBSpec struct {
// +optional
ServiceTemplate ofst.ServiceTemplateSpec `json:"serviceTemplate,omitempty" protobuf:"bytes,10,opt,name=serviceTemplate"`

// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
UpdateStrategy apps.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,11,opt,name=updateStrategy"`

// TLS contains tls configurations
// +optional
TLS *kmapi.TLSConfig `json:"tls,omitempty" protobuf:"bytes,15,opt,name=tls"`
TLS *kmapi.TLSConfig `json:"tls,omitempty" protobuf:"bytes,11,opt,name=tls"`

// Indicates that the database is paused and controller will not sync any changes made to this spec.
// +optional
Expand Down
4 changes: 0 additions & 4 deletions apis/kubedb/v1alpha1/memcached_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"kubedb.dev/apimachinery/apis/kubedb"
"kubedb.dev/apimachinery/crds"

apps "k8s.io/api/apps/v1"
"kmodules.xyz/client-go/apiextensions"
meta_util "kmodules.xyz/client-go/meta"
appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
Expand Down Expand Up @@ -144,9 +143,6 @@ func (m *Memcached) SetDefaults() {
}

// perform defaulting
if m.Spec.UpdateStrategy.Type == "" {
m.Spec.UpdateStrategy.Type = apps.RollingUpdateDeploymentStrategyType
}
if m.Spec.TerminationPolicy == "" {
m.Spec.TerminationPolicy = TerminationPolicyDelete
} else if m.Spec.TerminationPolicy == TerminationPolicyPause {
Expand Down

0 comments on commit 7075b38

Please sign in to comment.