Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions pkg/apis/mysql/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ var validVersions = []string{
defaultVersion,
}

// MySQLSecretRef holds reference to a custom secret
// which enables configuration of things like the
// MYSQL_ROOT_PASSWORD in a cluster
type MySQLSecretRef struct {
Name string `json:"name"`
}

// MySQLClusterSpec defines the attributes a user can specify when creating a cluster
type MySQLClusterSpec struct {
// Version defines the MySQL Docker image version.
Expand Down Expand Up @@ -73,7 +66,7 @@ type MySQLClusterSpec struct {
// If defined, we use this secret for configuring the MYSQL_ROOT_PASSWORD
// If it is not set we generate a secret dynamically
// +optional
SecretRef *MySQLSecretRef `json:"secretRef,omitempty"`
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}

// MySQLClusterPhase describes the state of the cluster.
Expand Down
18 changes: 1 addition & 17 deletions pkg/apis/mysql/v1/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (in *MySQLClusterSpec) DeepCopyInto(out *MySQLClusterSpec) {
if *in == nil {
*out = nil
} else {
*out = new(MySQLSecretRef)
*out = new(core_v1.LocalObjectReference)
**out = **in
}
}
Expand Down Expand Up @@ -484,22 +484,6 @@ func (in *MySQLRestoreList) DeepCopyObject() runtime.Object {
}
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MySQLSecretRef) DeepCopyInto(out *MySQLSecretRef) {
*out = *in
return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLSecretRef.
func (in *MySQLSecretRef) DeepCopy() *MySQLSecretRef {
if in == nil {
return nil
}
out := new(MySQLSecretRef)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) {
*out = *in
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/statefulsets/statefulset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestMySQLRootPasswordNoSecretRef(t *testing.T) {
func TestMySQLRootPasswordWithSecretRef(t *testing.T) {
cluster := &api.MySQLCluster{
Spec: api.MySQLClusterSpec{
SecretRef: &api.MySQLSecretRef{Name: "secret"},
SecretRef: &v1.LocalObjectReference{Name: "secret"},
},
}

Expand All @@ -54,7 +54,7 @@ func TestMySQLRootPasswordWithSecretRef(t *testing.T) {
func TestClusterWithoutPVCHasBackupContainerAndVolumes(t *testing.T) {
cluster := &api.MySQLCluster{
Spec: api.MySQLClusterSpec{
SecretRef: &api.MySQLSecretRef{Name: "secret"},
SecretRef: &v1.LocalObjectReference{Name: "secret"},
},
}

Expand All @@ -73,7 +73,7 @@ func TestClusterWithoutPVCHasBackupContainerAndVolumes(t *testing.T) {
func TestClusterWithPVCHasBackupContainerAndVolumes(t *testing.T) {
cluster := &api.MySQLCluster{
Spec: api.MySQLClusterSpec{
SecretRef: &api.MySQLSecretRef{Name: "secret"},
SecretRef: &v1.LocalObjectReference{Name: "secret"},
VolumeClaimTemplate: &v1.PersistentVolumeClaim{},
BackupVolumeClaimTemplate: &v1.PersistentVolumeClaim{},
},
Expand Down