Skip to content

Commit

Permalink
Add reconfigure ops api
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <[email protected]>
  • Loading branch information
pritamdas99 authored and raihankhan committed Aug 2, 2024
1 parent 44b0af7 commit 6ed5aaa
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 3 deletions.
53 changes: 52 additions & 1 deletion apis/ops/v1alpha1/openapi_generated.go

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

27 changes: 25 additions & 2 deletions apis/ops/v1alpha1/solr_ops_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type SolrOpsRequest struct {
Status OpsRequestStatus `json:"status,omitempty"`
}

// +kubebuilder:validation:Enum=UpdateVersion;VerticalScaling;VolumeExpansion;Restart
// ENUM(UpdateVersion, VerticalScaling, VolumeExpansion, Restart)
// +kubebuilder:validation:Enum=UpdateVersion;VerticalScaling;VolumeExpansion;Reconfigure;Restart
// ENUM(UpdateVersion, VerticalScaling, VolumeExpansion, Restart, Reconfigure)
type SolrOpsRequestType string

// DruidOpsRequestSpec is the spec for DruidOpsRequest
Expand All @@ -67,6 +67,8 @@ type SolrOpsRequestSpec struct {
VolumeExpansion *SolrVolumeExpansionSpec `json:"volumeExpansion,omitempty"`
// Specifies information necessary for restarting database
Restart *RestartSpec `json:"restart,omitempty"`
// Specifies information necessary for custom configuration of rabbitmq
Configuration *SolrCustomConfigurationSpec `json:"configuration,omitempty"`
// Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure.
Timeout *metav1.Duration `json:"timeout,omitempty"`
// ApplyOption is to control the execution of OpsRequest depending on the database state.
Expand Down Expand Up @@ -102,6 +104,27 @@ type SolrUpdateVersionSpec struct {
TargetVersion string `json:"targetVersion,omitempty"`
}

// SolrCustomConfigurationSpec is the spec for Reconfiguring the rabbitmq Settings
type SolrCustomConfigurationSpec struct {
// ConfigSecret is an optional field to provide custom configuration file for database.
// +optional
ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"`
// ApplyConfig is an optional field to provide rabbitmq configuration.
// Provided configuration will be applied to config files stored in ConfigSecret.
// If the ConfigSecret is missing, the operator will create a new k8s secret by the
// following naming convention: {db-name}-user-config .
// Expected input format:
// applyConfig:
// rabbitmq.conf: |
// key=value
// +optional
ApplyConfig map[string]string `json:"applyConfig,omitempty"`
// If set to "true", the user provided configuration will be removed.
// The rabbitmq cluster will start will default configuration that is generated by the operator.
// +optional
RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"`
}

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

// SolrOpsRequestList is a list of DruidOpsRequests
Expand Down
5 changes: 5 additions & 0 deletions apis/ops/v1alpha1/solr_ops_types_enum.go

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

33 changes: 33 additions & 0 deletions apis/ops/v1alpha1/zz_generated.deepcopy.go

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

17 changes: 17 additions & 0 deletions crds/ops.kubedb.com_solropsrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ spec:
- IfReady
- Always
type: string
configuration:
properties:
applyConfig:
additionalProperties:
type: string
type: object
configSecret:
properties:
name:
default: ""
type: string
type: object
x-kubernetes-map-type: atomic
removeCustomConfig:
type: boolean
type: object
databaseRef:
properties:
name:
Expand All @@ -64,6 +80,7 @@ spec:
- UpdateVersion
- VerticalScaling
- VolumeExpansion
- Reconfigure
- Restart
type: string
updateVersion:
Expand Down

0 comments on commit 6ed5aaa

Please sign in to comment.