Skip to content

Commit

Permalink
Add mssql ops apis for reconfigure tls
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 11, 2024
1 parent a8c8c1e commit dd3209d
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 4 deletions.
18 changes: 17 additions & 1 deletion apis/ops/v1alpha1/mssqlserver_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
package v1alpha1

import (
dbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2"

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -66,7 +68,7 @@ type MSSQLServerOpsRequestSpec struct {
// Specifies information necessary for custom configuration of MSSQLServer
Configuration *MSSQLServerCustomConfigurationSpec `json:"configuration,omitempty"`
// Specifies information necessary for configuring TLS
TLS *TLSSpec `json:"tls,omitempty"`
TLS *MSSQLServerTLSSpec `json:"tls,omitempty"`
// Specifies information necessary for configuring authSecret of the database
Authentication *AuthSpec `json:"authentication,omitempty"`
// Specifies information necessary for restarting database
Expand Down Expand Up @@ -119,6 +121,20 @@ type MSSQLServerCustomConfigurationSpec struct {
RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"`
}

type MSSQLServerTLSSpec struct {
// SQLServerTLSSpec contains updated tls configurations for client and server.
// +optional
dbapi.SQLServerTLSConfig `json:",inline,omitempty"`

// RotateCertificates tells operator to initiate certificate rotation
// +optional
RotateCertificates bool `json:"rotateCertificates,omitempty"`

// Remove tells operator to remove TLS configuration
// +optional
Remove bool `json:"remove,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// MSSQLServerOpsRequestList is a list of MSSQLServerOpsRequests
Expand Down
61 changes: 59 additions & 2 deletions apis/ops/v1alpha1/openapi_generated.go

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

19 changes: 18 additions & 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.

4 changes: 4 additions & 0 deletions crds/ops.kubedb.com_mssqlserveropsrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ spec:
- alias
type: object
type: array
clientTLS:
type: boolean
issuerRef:
properties:
apiGroup:
Expand All @@ -195,6 +197,8 @@ spec:
type: boolean
rotateCertificates:
type: boolean
required:
- clientTLS
type: object
type:
enum:
Expand Down

0 comments on commit dd3209d

Please sign in to comment.