Skip to content

Commit

Permalink
Add review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <[email protected]>
  • Loading branch information
Neaj-Morshad-101 committed Nov 19, 2024
1 parent 2e8e22a commit cff3d8b
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 74 deletions.
5 changes: 5 additions & 0 deletions apis/kubedb/v1alpha2/mssqlserver_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ func (m *MSSQLServer) SetTLSDefaults() {
return
}

if m.Spec.TLS.ClientTLS == nil {
defaultValue := false
m.Spec.TLS.ClientTLS = &defaultValue
}

// Server-cert
defaultServerOrg := []string{kubedb.KubeDBOrganization}
defaultServerOrgUnit := []string{string(MSSQLServerServerCert)}
Expand Down
4 changes: 2 additions & 2 deletions apis/kubedb/v1alpha2/mssqlserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type MSSQLServerSpec struct {
PodTemplate *ofst.PodTemplateSpec `json:"podTemplate,omitempty"`

// TLS contains tls configurations for client and server.
TLS *SQLServerTLSConfig `json:"tls,omitempty"`
TLS *MSSQLServerTLSConfig `json:"tls,omitempty"`

// ServiceTemplates is an optional configuration for services used to expose database
// +optional
Expand Down Expand Up @@ -132,7 +132,7 @@ type MSSQLServerSpec struct {
Archiver *Archiver `json:"archiver,omitempty"`
}

type SQLServerTLSConfig struct {
type MSSQLServerTLSConfig struct {
kmapi.TLSConfig `json:",inline"`

// +optional
Expand Down
4 changes: 0 additions & 4 deletions apis/kubedb/v1alpha2/mssqlserver_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ func (m *MSSQLServer) ValidateCreateOrUpdate() field.ErrorList {
allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("tls").Child("issuerRef"),
m.Name, "spec.tls.issuerRef' is missing"))
}
if m.Spec.TLS.ClientTLS == nil {
allErr = append(allErr, field.Invalid(field.NewPath("spec").Child("tls").Child("clientTLS"),
m.Name, "spec.tls.clientTLS' is missing"))
}
}

if m.Spec.PodTemplate != nil {
Expand Down
86 changes: 43 additions & 43 deletions apis/kubedb/v1alpha2/openapi_generated.go

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

46 changes: 23 additions & 23 deletions apis/kubedb/v1alpha2/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion apis/ops/v1alpha1/mssqlserver_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ type MSSQLServerCustomConfigurationSpec struct {
type MSSQLServerTLSSpec struct {
// SQLServerTLSSpec contains updated tls configurations for client and server.
// +optional
dbapi.SQLServerTLSConfig `json:",inline,omitempty"`
dbapi.MSSQLServerTLSConfig `json:",inline,omitempty"`

// RotateCertificates tells operator to initiate certificate rotation
// +optional
Expand Down
2 changes: 1 addition & 1 deletion apis/ops/v1alpha1/zz_generated.deepcopy.go

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

0 comments on commit cff3d8b

Please sign in to comment.