diff --git a/.github/workflows/cicd-pull-request.yml b/.github/workflows/cicd-pull-request.yml
index 98e3ccf3d72..3fbc1064af2 100644
--- a/.github/workflows/cicd-pull-request.yml
+++ b/.github/workflows/cicd-pull-request.yml
@@ -218,16 +218,6 @@ jobs:
DOCKERFILE_PATH: "./docker/Dockerfile-tools"
secrets: inherit
- check-datascript-image:
- needs: trigger-mode
- if: contains(needs.trigger-mode.outputs.trigger-mode, '[docker]')
- uses: apecloud/apecloud-cd/.github/workflows/release-image-check.yml@v0.1.24
- with:
- IMG: "apecloud/kubeblocks-datascript"
- BUILDX_PLATFORMS: "linux/amd64"
- DOCKERFILE_PATH: "./docker/Dockerfile-datascript"
- secrets: inherit
-
check-dataprotection-image:
needs: trigger-mode
if: contains(needs.trigger-mode.outputs.trigger-mode, '[docker]')
@@ -256,7 +246,7 @@ jobs:
pr-check:
name: make test
needs: [ trigger-mode, test-parallel, pr-pre-check, pr-make-test,
- check-image, check-tools-image, check-datascript-image, check-dataprotection-image, check-helm ]
+ check-image, check-tools-image, check-dataprotection-image, check-helm ]
if: ${{ github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'pre-approve') && always() }}
runs-on: ubuntu-latest
steps:
@@ -296,11 +286,6 @@ jobs:
exit 1
fi
- if [[ "${{ needs.check-datascript-image.result }}" == "failure" || "${{ needs.check-datascript-image.result }}" == "cancelled" ]]; then
- echo "release datascript image fail"
- exit 1
- fi
-
if [[ "${{ needs.check-dataprotection-image.result }}" == "failure" || "${{ needs.check-dataprotection-image.result }}" == "cancelled" ]]; then
echo "release dataprotection image fail"
exit 1
diff --git a/.github/workflows/cicd-push.yml b/.github/workflows/cicd-push.yml
index 56d1f359d24..e15498237a6 100644
--- a/.github/workflows/cicd-push.yml
+++ b/.github/workflows/cicd-push.yml
@@ -211,16 +211,6 @@ jobs:
DOCKERFILE_PATH: "./docker/Dockerfile-tools"
secrets: inherit
- check-datascript-image:
- needs: trigger-mode
- if: ${{ contains(needs.trigger-mode.outputs.trigger-mode, '[docker]') }}
- uses: apecloud/apecloud-cd/.github/workflows/release-image-check.yml@v0.1.24
- with:
- IMG: "apecloud/kubeblocks-datascript"
- BUILDX_PLATFORMS: "linux/amd64"
- DOCKERFILE_PATH: "./docker/Dockerfile-datascript"
- secrets: inherit
-
check-dataprotection-image:
needs: trigger-mode
if: ${{ contains(needs.trigger-mode.outputs.trigger-mode, '[docker]') }}
@@ -313,7 +303,7 @@ jobs:
push-check:
name: make-test
needs: [ trigger-mode, push-pre-check, push-make-test, check-image, check-tools-image,
- check-datascript-image, check-dataprotection-image, check-helm, apis-doc, check-license-header ]
+ check-dataprotection-image, check-helm, apis-doc, check-license-header ]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
@@ -343,11 +333,6 @@ jobs:
exit 1
fi
- if [[ "${{ needs.check-datascript-image.result }}" == "failure" || "${{ needs.check-datascript-image.result }}" == "cancelled" ]]; then
- echo "check datascript image fail"
- exit 1
- fi
-
if [[ "${{ needs.check-dataprotection-image.result }}" == "failure" || "${{ needs.check-dataprotection-image.result }}" == "cancelled" ]]; then
echo "check dataprotection image fail"
exit 1
diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml
index f1b72991f33..5076763d0c9 100644
--- a/.github/workflows/release-image.yml
+++ b/.github/workflows/release-image.yml
@@ -19,7 +19,6 @@ on:
- Dockerfile
- Dockerfile-charts
- Dockerfile-dataprotection
- - Dockerfile-datascript
- Dockerfile-dev
- Dockerfile-tools
release:
@@ -93,17 +92,6 @@ jobs:
DOCKERFILE_PATH: "./docker/Dockerfile-tools"
secrets: inherit
- release-datascript-image:
- if: ${{ inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-datascript' }}
- needs: release-version
- uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.24
- with:
- IMG: "apecloud/kubeblocks-datascript"
- VERSION: "${{ needs.release-version.outputs.release-version }}"
- APECD_REF: "v0.1.24"
- DOCKERFILE_PATH: "./docker/Dockerfile-datascript"
- secrets: inherit
-
release-dataprotection-image:
if: ${{ inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-dataprotection' }}
needs: release-version
@@ -142,7 +130,7 @@ jobs:
release-message:
runs-on: ubuntu-latest
- needs: [ release-image, release-tools-image, release-datascript-image, release-dataprotection-image ]
+ needs: [ release-image, release-tools-image, release-dataprotection-image ]
outputs:
content-result: ${{ steps.release_message.outputs.content_result }}
release-version: ${{ steps.release_message.outputs.release_version }}
@@ -157,7 +145,7 @@ jobs:
echo 'artifact_key='${ARTIFACT_KEY} >> $GITHUB_OUTPUT
CONTENT="error"
- if [[ "${{ needs.release-image.result }}" == "success" && "${{ needs.release-tools-image.result }}" == "success" && "${{ needs.release-datascript-image.result }}" == "success" && "${{ needs.release-dataprotection-image.result }}" == "success" ]]; then
+ if [[ "${{ needs.release-image.result }}" == "success" && "${{ needs.release-tools-image.result }}" == "success" && "${{ needs.release-dataprotection-image.result }}" == "success" ]]; then
CONTENT="success"
echo "success" > ${ARTIFACT_KEY}
else
diff --git a/apis/apps/v1alpha1/opsrequest_conditions.go b/apis/apps/v1alpha1/opsrequest_conditions.go
index 8de6aafec0a..ed7533bc8a7 100644
--- a/apis/apps/v1alpha1/opsrequest_conditions.go
+++ b/apis/apps/v1alpha1/opsrequest_conditions.go
@@ -41,7 +41,6 @@ const (
ConditionTypeStart = "Starting"
ConditionTypeVersionUpgrading = "VersionUpgrading"
ConditionTypeExpose = "Exposing"
- ConditionTypeDataScript = "ExecuteDataScript"
ConditionTypeBackup = "Backup"
ConditionTypeInstanceRebuilding = "InstancesRebuilding"
ConditionTypeCustomOperation = "CustomOperation"
@@ -304,20 +303,6 @@ func NewReconfigureCondition(ops *OpsRequest) *metav1.Condition {
}
}
-func NewDataScriptCondition(ops *OpsRequest) *metav1.Condition {
- return newOpsCondition(ops, ConditionTypeDataScript, "DataScriptStarted", fmt.Sprintf("Start to execute data script in Cluster: %s", ops.Spec.GetClusterName()))
-}
-
-func newOpsCondition(_ *OpsRequest, condType, reason, message string) *metav1.Condition {
- return &metav1.Condition{
- Type: condType,
- Status: metav1.ConditionTrue,
- Reason: reason,
- LastTransitionTime: metav1.Now(),
- Message: message,
- }
-}
-
// NewReconfigureRunningCondition creates a condition that the OpsRequest reconfigure workflow
func NewReconfigureRunningCondition(ops *OpsRequest, conditionType string, configSpecName string, info ...string) *metav1.Condition {
status := metav1.ConditionTrue
diff --git a/apis/apps/v1alpha1/opsrequest_types.go b/apis/apps/v1alpha1/opsrequest_types.go
index bb9b8ab701d..1c8dd0eca13 100644
--- a/apis/apps/v1alpha1/opsrequest_types.go
+++ b/apis/apps/v1alpha1/opsrequest_types.go
@@ -71,7 +71,7 @@ type OpsRequestSpec struct {
// Specifies the type of this operation. Supported types include "Start", "Stop", "Restart", "Switchover",
// "VerticalScaling", "HorizontalScaling", "VolumeExpansion", "Reconfiguring", "Upgrade", "Backup", "Restore",
- // "Expose", "DataScript", "RebuildInstance", "Custom".
+ // "Expose", "RebuildInstance", "Custom".
//
// Note: This field is immutable once set.
//
@@ -194,16 +194,6 @@ type SpecificOpsRequest struct {
// +optional
ExposeList []Expose `json:"expose,omitempty"`
- // Specifies the image and scripts for executing engine-specific operations such as creating databases or users.
- // It supports limited engines including MySQL, PostgreSQL, Redis, MongoDB.
- //
- // ScriptSpec has been replaced by the more versatile OpsDefinition.
- // It is recommended to use OpsDefinition instead.
- // ScriptSpec is deprecated and will be removed in a future version.
- //
- // +optional
- ScriptSpec *ScriptSpec `json:"scriptSpec,omitempty"`
-
// Specifies the parameters to backup a Cluster.
// +optional
Backup *Backup `json:"backup,omitempty"`
@@ -870,68 +860,6 @@ type PointInTimeRefSpec struct {
Ref RefNamespaceName `json:"ref,omitempty"`
}
-// ScriptSpec is a legacy feature for executing engine-specific operations such as creating databases or users.
-// It supports limited engines including MySQL, PostgreSQL, Redis, MongoDB.
-//
-// ScriptSpec has been replaced by the more versatile OpsDefinition.
-// It is recommended to use OpsDefinition instead. ScriptSpec is deprecated and will be removed in a future version.
-type ScriptSpec struct {
- // Specifies the name of the Component.
- ComponentOps `json:",inline"`
-
- // Specifies the image to be used to execute scripts.
- //
- // By default, the image "apecloud/kubeblocks-datascript:latest" is used.
- //
- // +optional
- Image string `json:"image,omitempty"`
-
- // Defines the secret to be used to execute the script. If not specified, the default cluster root credential secret is used.
- // +optional
- Secret *ScriptSecret `json:"secret,omitempty"`
-
- // Defines the content of scripts to be executed.
- //
- // All scripts specified in this field will be executed in the order they are provided.
- //
- // Note: this field cannot be modified once set.
- //
- // +optional
- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.scriptSpec.script"
- Script []string `json:"script,omitempty"`
-
- // Specifies the sources of the scripts to be executed.
- // Each script can be imported either from a ConfigMap or a Secret.
- //
- // All scripts obtained from the sources specified in this field will be executed after
- // any scripts provided in the `script` field.
- //
- // Execution order:
- // 1. Scripts provided in the `script` field, in the order of the scripts listed.
- // 2. Scripts imported from ConfigMaps, in the order of the sources listed.
- // 3. Scripts imported from Secrets, in the order of the sources listed.
- //
- // Note: this field cannot be modified once set.
- //
- // +optional
- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.scriptSpec.scriptFrom"
- ScriptFrom *ScriptFrom `json:"scriptFrom,omitempty"`
-
- // Specifies the labels used to select the Pods on which the script should be executed.
- //
- // By default, the script is executed on the Pod associated with the service named "{clusterName}-{componentName}",
- // which typically routes to the Pod with the primary/leader role.
- //
- // However, some Components, such as Redis, do not synchronize account information between primary and secondary Pods.
- // In these cases, the script must be executed on all replica Pods matching the selector.
- //
- // Note: this field cannot be modified once set.
- //
- // +optional
- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.scriptSpec.script.selector"
- Selector *metav1.LabelSelector `json:"selector,omitempty"`
-}
-
type Backup struct {
// Specifies the name of the Backup custom resource.
//
@@ -1022,42 +950,6 @@ type Restore struct {
DeferPostReadyUntilClusterRunning bool `json:"deferPostReadyUntilClusterRunning,omitempty"`
}
-// ScriptSecret represents the secret that is used to execute the script.
-type ScriptSecret struct {
- // Specifies the name of the secret.
- // +kubebuilder:validation:Required
- // +kubebuilder:validation:MaxLength=63
- // +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
- Name string `json:"name"`
- // Used to specify the username part of the secret.
- // +kubebuilder:default:="username"
- // +optional
- UsernameKey string `json:"usernameKey,omitempty"`
- // Used to specify the password part of the secret.
- // +kubebuilder:default:="password"
- // +optional
- PasswordKey string `json:"passwordKey,omitempty"`
-}
-
-// ScriptFrom specifies the source of the script to be executed, which can be either a ConfigMap or a Secret.
-type ScriptFrom struct {
- // A list of ConfigMapKeySelector objects, each specifies a ConfigMap and a key containing the script.
- //
- // Note: This field cannot be modified once set.
- //
- // +optional
- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.scriptSpec.scriptFrom.configMapRef"
- ConfigMapRef []corev1.ConfigMapKeySelector `json:"configMapRef,omitempty"`
-
- // A list of SecretKeySelector objects, each specifies a Secret and a key containing the script.
- //
- // Note: This field cannot be modified once set.
- //
- // +optional
- // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="forbidden to update spec.scriptSpec.scriptFrom.secretRef"
- SecretRef []corev1.SecretKeySelector `json:"secretRef,omitempty"`
-}
-
// OpsRequestStatus represents the observed state of an OpsRequest.
type OpsRequestStatus struct {
// Records the cluster generation after the OpsRequest action has been handled.
@@ -1108,7 +1000,7 @@ type OpsRequestStatus struct {
// Describes the detailed status of the OpsRequest.
// Possible condition types include "Cancelled", "WaitForProgressing", "Validated", "Succeed", "Failed", "Restarting",
// "VerticalScaling", "HorizontalScaling", "VolumeExpanding", "Reconfigure", "Switchover", "Stopping", "Starting",
- // "VersionUpgrading", "Exposing", "ExecuteDataScript", "Backup", "InstancesRebuilding", "CustomOperation".
+ // "VersionUpgrading", "Exposing", "Backup", "InstancesRebuilding", "CustomOperation".
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
diff --git a/apis/apps/v1alpha1/opsrequest_validation.go b/apis/apps/v1alpha1/opsrequest_validation.go
index ec5aceffd4d..4f650084f11 100644
--- a/apis/apps/v1alpha1/opsrequest_validation.go
+++ b/apis/apps/v1alpha1/opsrequest_validation.go
@@ -135,8 +135,6 @@ func (r *OpsRequest) validateOps(ctx context.Context,
return r.validateReconfigure(ctx, k8sClient, cluster)
case SwitchoverType:
return r.validateSwitchover(ctx, k8sClient, cluster)
- case DataScriptType:
- return r.validateDataScript(ctx, k8sClient, cluster)
case ExposeType:
return r.validateExpose(ctx, cluster)
case RebuildInstanceType:
@@ -730,48 +728,6 @@ func (r *OpsRequest) getSCNameByPvcAndCheckStorageSize(ctx context.Context,
return pvc.Spec.StorageClassName, nil
}
-// validateDataScript validates the data script.
-func (r *OpsRequest) validateDataScript(ctx context.Context, cli client.Client, cluster *Cluster) error {
- validateScript := func(spec *ScriptSpec) error {
- rawScripts := spec.Script
- scriptsFrom := spec.ScriptFrom
- if len(rawScripts) == 0 && (scriptsFrom == nil) {
- return fmt.Errorf("spec.scriptSpec.script and spec.scriptSpec.scriptFrom can not be empty at the same time")
- }
- if scriptsFrom != nil {
- if scriptsFrom.ConfigMapRef == nil && scriptsFrom.SecretRef == nil {
- return fmt.Errorf("spec.scriptSpec.scriptFrom.configMapRefs and spec.scriptSpec.scriptFrom.secretRefs can not be empty at the same time")
- }
- for _, configMapRef := range scriptsFrom.ConfigMapRef {
- if err := cli.Get(ctx, types.NamespacedName{Name: configMapRef.Name, Namespace: r.Namespace}, &corev1.ConfigMap{}); err != nil {
- return err
- }
- }
- for _, secret := range scriptsFrom.SecretRef {
- if err := cli.Get(ctx, types.NamespacedName{Name: secret.Name, Namespace: r.Namespace}, &corev1.Secret{}); err != nil {
- return err
- }
- }
- }
- return nil
- }
-
- scriptSpec := r.Spec.ScriptSpec
- if scriptSpec == nil {
- return notEmptyError("spec.scriptSpec")
- }
-
- if err := r.checkComponentExistence(cluster, []ComponentOps{scriptSpec.ComponentOps}); err != nil {
- return err
- }
-
- if err := validateScript(scriptSpec); err != nil {
- return err
- }
-
- return nil
-}
-
// validateVerticalResourceList checks if k8s resourceList is legal
func validateVerticalResourceList(resourceList map[corev1.ResourceName]resource.Quantity) (string, error) {
for k := range resourceList {
diff --git a/apis/apps/v1alpha1/type.go b/apis/apps/v1alpha1/type.go
index 140d4358f98..b9001c668c6 100644
--- a/apis/apps/v1alpha1/type.go
+++ b/apis/apps/v1alpha1/type.go
@@ -367,7 +367,7 @@ const (
// OpsType defines operation types.
// +enum
-// +kubebuilder:validation:Enum={Upgrade,VerticalScaling,VolumeExpansion,HorizontalScaling,Restart,Reconfiguring,Start,Stop,Expose,Switchover,DataScript,Backup,Restore,RebuildInstance,Custom}
+// +kubebuilder:validation:Enum={Upgrade,VerticalScaling,VolumeExpansion,HorizontalScaling,Restart,Reconfiguring,Start,Stop,Expose,Switchover,Backup,Restore,RebuildInstance,Custom}
type OpsType string
const (
@@ -381,7 +381,6 @@ const (
StopType OpsType = "Stop" // StopType the stop operation will delete all pods in a cluster concurrently.
StartType OpsType = "Start" // StartType the start operation will start the pods which is deleted in stop operation.
ExposeType OpsType = "Expose"
- DataScriptType OpsType = "DataScript" // DataScriptType the data script operation will execute the data script against the cluster.
BackupType OpsType = "Backup"
RestoreType OpsType = "Restore"
RebuildInstanceType OpsType = "RebuildInstance" // RebuildInstance rebuilding an instance is very useful when a node is offline or an instance is unrecoverable.
diff --git a/apis/apps/v1alpha1/zz_generated.deepcopy.go b/apis/apps/v1alpha1/zz_generated.deepcopy.go
index fb60452a065..150aceeb326 100644
--- a/apis/apps/v1alpha1/zz_generated.deepcopy.go
+++ b/apis/apps/v1alpha1/zz_generated.deepcopy.go
@@ -4426,86 +4426,6 @@ func (in *SchedulingPolicy) DeepCopy() *SchedulingPolicy {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ScriptFrom) DeepCopyInto(out *ScriptFrom) {
- *out = *in
- if in.ConfigMapRef != nil {
- in, out := &in.ConfigMapRef, &out.ConfigMapRef
- *out = make([]v1.ConfigMapKeySelector, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- if in.SecretRef != nil {
- in, out := &in.SecretRef, &out.SecretRef
- *out = make([]v1.SecretKeySelector, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptFrom.
-func (in *ScriptFrom) DeepCopy() *ScriptFrom {
- if in == nil {
- return nil
- }
- out := new(ScriptFrom)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ScriptSecret) DeepCopyInto(out *ScriptSecret) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptSecret.
-func (in *ScriptSecret) DeepCopy() *ScriptSecret {
- if in == nil {
- return nil
- }
- out := new(ScriptSecret)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ScriptSpec) DeepCopyInto(out *ScriptSpec) {
- *out = *in
- out.ComponentOps = in.ComponentOps
- if in.Secret != nil {
- in, out := &in.Secret, &out.Secret
- *out = new(ScriptSecret)
- **out = **in
- }
- if in.Script != nil {
- in, out := &in.Script, &out.Script
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.ScriptFrom != nil {
- in, out := &in.ScriptFrom, &out.ScriptFrom
- *out = new(ScriptFrom)
- (*in).DeepCopyInto(*out)
- }
- if in.Selector != nil {
- in, out := &in.Selector, &out.Selector
- *out = new(metav1.LabelSelector)
- (*in).DeepCopyInto(*out)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptSpec.
-func (in *ScriptSpec) DeepCopy() *ScriptSpec {
- if in == nil {
- return nil
- }
- out := new(ScriptSpec)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SecretRef) DeepCopyInto(out *SecretRef) {
*out = *in
@@ -4939,11 +4859,6 @@ func (in *SpecificOpsRequest) DeepCopyInto(out *SpecificOpsRequest) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
- if in.ScriptSpec != nil {
- in, out := &in.ScriptSpec, &out.ScriptSpec
- *out = new(ScriptSpec)
- (*in).DeepCopyInto(*out)
- }
if in.Backup != nil {
in, out := &in.Backup, &out.Backup
*out = new(Backup)
diff --git a/cmd/manager/main.go b/cmd/manager/main.go
index 5a43ff6169d..2f57010096c 100644
--- a/cmd/manager/main.go
+++ b/cmd/manager/main.go
@@ -135,7 +135,6 @@ func init() {
viper.SetDefault(constant.CfgHostPortConfigMapName, "kubeblocks-host-ports")
viper.SetDefault(constant.CfgHostPortIncludeRanges, "1025-65536")
viper.SetDefault(constant.CfgHostPortExcludeRanges, "6443,10250,10257,10259,2379-2380,30000-32767")
- viper.SetDefault(constant.KBDataScriptClientsImage, "apecloud/kubeblocks-datascript:latest")
viper.SetDefault(constant.KubernetesClusterDomainEnv, constant.DefaultDNSDomain)
viper.SetDefault(instanceset.MaxPlainRevisionCount, 1024)
viper.SetDefault(instanceset.FeatureGateIgnorePodVerticalScaling, false)
diff --git a/config/crd/bases/apps.kubeblocks.io_opsrequests.yaml b/config/crd/bases/apps.kubeblocks.io_opsrequests.yaml
index 5551e540d88..ac1191980e8 100644
--- a/config/crd/bases/apps.kubeblocks.io_opsrequests.yaml
+++ b/config/crd/bases/apps.kubeblocks.io_opsrequests.yaml
@@ -4476,207 +4476,6 @@ spec:
required:
- backupName
type: object
- scriptSpec:
- description: |-
- Specifies the image and scripts for executing engine-specific operations such as creating databases or users.
- It supports limited engines including MySQL, PostgreSQL, Redis, MongoDB.
-
-
- ScriptSpec has been replaced by the more versatile OpsDefinition.
- It is recommended to use OpsDefinition instead.
- ScriptSpec is deprecated and will be removed in a future version.
- properties:
- componentName:
- description: Specifies the name of the Component.
- type: string
- image:
- description: |-
- Specifies the image to be used to execute scripts.
-
-
- By default, the image "apecloud/kubeblocks-datascript:latest" is used.
- type: string
- script:
- description: |-
- Defines the content of scripts to be executed.
-
-
- All scripts specified in this field will be executed in the order they are provided.
-
-
- Note: this field cannot be modified once set.
- items:
- type: string
- type: array
- x-kubernetes-validations:
- - message: forbidden to update spec.scriptSpec.script
- rule: self == oldSelf
- scriptFrom:
- description: |-
- Specifies the sources of the scripts to be executed.
- Each script can be imported either from a ConfigMap or a Secret.
-
-
- All scripts obtained from the sources specified in this field will be executed after
- any scripts provided in the `script` field.
-
-
- Execution order:
- 1. Scripts provided in the `script` field, in the order of the scripts listed.
- 2. Scripts imported from ConfigMaps, in the order of the sources listed.
- 3. Scripts imported from Secrets, in the order of the sources listed.
-
-
- Note: this field cannot be modified once set.
- properties:
- configMapRef:
- description: |-
- A list of ConfigMapKeySelector objects, each specifies a ConfigMap and a key containing the script.
-
-
- Note: This field cannot be modified once set.
- items:
- description: Selects a key from a ConfigMap.
- properties:
- key:
- description: The key to select.
- type: string
- name:
- description: |-
- Name of the referent.
- More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Add other useful fields. apiVersion, kind, uid?
- type: string
- optional:
- description: Specify whether the ConfigMap or its key
- must be defined
- type: boolean
- required:
- - key
- type: object
- x-kubernetes-map-type: atomic
- type: array
- x-kubernetes-validations:
- - message: forbidden to update spec.scriptSpec.scriptFrom.configMapRef
- rule: self == oldSelf
- secretRef:
- description: |-
- A list of SecretKeySelector objects, each specifies a Secret and a key containing the script.
-
-
- Note: This field cannot be modified once set.
- items:
- description: SecretKeySelector selects a key of a Secret.
- properties:
- key:
- description: The key of the secret to select from. Must
- be a valid secret key.
- type: string
- name:
- description: |-
- Name of the referent.
- More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Add other useful fields. apiVersion, kind, uid?
- type: string
- optional:
- description: Specify whether the Secret or its key must
- be defined
- type: boolean
- required:
- - key
- type: object
- x-kubernetes-map-type: atomic
- type: array
- x-kubernetes-validations:
- - message: forbidden to update spec.scriptSpec.scriptFrom.secretRef
- rule: self == oldSelf
- type: object
- x-kubernetes-validations:
- - message: forbidden to update spec.scriptSpec.scriptFrom
- rule: self == oldSelf
- secret:
- description: Defines the secret to be used to execute the script.
- If not specified, the default cluster root credential secret
- is used.
- properties:
- name:
- description: Specifies the name of the secret.
- maxLength: 63
- pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
- type: string
- passwordKey:
- default: password
- description: Used to specify the password part of the secret.
- type: string
- usernameKey:
- default: username
- description: Used to specify the username part of the secret.
- type: string
- required:
- - name
- type: object
- selector:
- description: |-
- Specifies the labels used to select the Pods on which the script should be executed.
-
-
- By default, the script is executed on the Pod associated with the service named "{clusterName}-{componentName}",
- which typically routes to the Pod with the primary/leader role.
-
-
- However, some Components, such as Redis, do not synchronize account information between primary and secondary Pods.
- In these cases, the script must be executed on all replica Pods matching the selector.
-
-
- Note: this field cannot be modified once set.
- properties:
- matchExpressions:
- description: matchExpressions is a list of label selector
- requirements. The requirements are ANDed.
- items:
- description: |-
- A label selector requirement is a selector that contains values, a key, and an operator that
- relates the key and values.
- properties:
- key:
- description: key is the label key that the selector
- applies to.
- type: string
- operator:
- description: |-
- operator represents a key's relationship to a set of values.
- Valid operators are In, NotIn, Exists and DoesNotExist.
- type: string
- values:
- description: |-
- values is an array of string values. If the operator is In or NotIn,
- the values array must be non-empty. If the operator is Exists or DoesNotExist,
- the values array must be empty. This array is replaced during a strategic
- merge patch.
- items:
- type: string
- type: array
- required:
- - key
- - operator
- type: object
- type: array
- matchLabels:
- additionalProperties:
- type: string
- description: |-
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
- map is equivalent to an element of matchExpressions, whose key field is "key", the
- operator is "In", and the values array contains only "value". The requirements are ANDed.
- type: object
- type: object
- x-kubernetes-map-type: atomic
- x-kubernetes-validations:
- - message: forbidden to update spec.scriptSpec.script.selector
- rule: self == oldSelf
- required:
- - componentName
- type: object
switchover:
description: Lists Switchover objects, each specifying a Component
to perform the switchover operation.
@@ -4739,7 +4538,7 @@ spec:
description: |-
Specifies the type of this operation. Supported types include "Start", "Stop", "Restart", "Switchover",
"VerticalScaling", "HorizontalScaling", "VolumeExpansion", "Reconfiguring", "Upgrade", "Backup", "Restore",
- "Expose", "DataScript", "RebuildInstance", "Custom".
+ "Expose", "RebuildInstance", "Custom".
Note: This field is immutable once set.
@@ -4754,7 +4553,6 @@ spec:
- Stop
- Expose
- Switchover
- - DataScript
- Backup
- Restore
- RebuildInstance
@@ -5207,7 +5005,7 @@ spec:
Describes the detailed status of the OpsRequest.
Possible condition types include "Cancelled", "WaitForProgressing", "Validated", "Succeed", "Failed", "Restarting",
"VerticalScaling", "HorizontalScaling", "VolumeExpanding", "Reconfigure", "Switchover", "Stopping", "Starting",
- "VersionUpgrading", "Exposing", "ExecuteDataScript", "Backup", "InstancesRebuilding", "CustomOperation".
+ "VersionUpgrading", "Exposing", "Backup", "InstancesRebuilding", "CustomOperation".
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
diff --git a/controllers/apps/operations/datascript.go b/controllers/apps/operations/datascript.go
deleted file mode 100644
index 051bbf480cf..00000000000
--- a/controllers/apps/operations/datascript.go
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
-Copyright (C) 2022-2024 ApeCloud Co., Ltd
-
-This file is part of KubeBlocks project
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Affero General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with this program. If not, see
Specifies the type of this operation. Supported types include “Start”, “Stop”, “Restart”, “Switchover”, “VerticalScaling”, “HorizontalScaling”, “VolumeExpansion”, “Reconfiguring”, “Upgrade”, “Backup”, “Restore”, -“Expose”, “DataScript”, “RebuildInstance”, “Custom”.
+“Expose”, “RebuildInstance”, “Custom”.Note: This field is immutable once set.
-(Appears on:CustomOpsComponent, HorizontalScaling, RebuildInstance, Reconfigure, ScriptSpec, SpecificOpsRequest, Switchover, UpgradeComponent, VerticalScaling, VolumeExpansion) +(Appears on:CustomOpsComponent, HorizontalScaling, RebuildInstance, Reconfigure, SpecificOpsRequest, Switchover, UpgradeComponent, VerticalScaling, VolumeExpansion)
ComponentOps specifies the Component to be operated on.
@@ -12248,7 +12248,7 @@ OpsTypeSpecifies the type of this operation. Supported types include “Start”, “Stop”, “Restart”, “Switchover”, “VerticalScaling”, “HorizontalScaling”, “VolumeExpansion”, “Reconfiguring”, “Upgrade”, “Backup”, “Restore”, -“Expose”, “DataScript”, “RebuildInstance”, “Custom”.
+“Expose”, “RebuildInstance”, “Custom”.Note: This field is immutable once set.
Describes the detailed status of the OpsRequest. Possible condition types include “Cancelled”, “WaitForProgressing”, “Validated”, “Succeed”, “Failed”, “Restarting”, “VerticalScaling”, “HorizontalScaling”, “VolumeExpanding”, “Reconfigure”, “Switchover”, “Stopping”, “Starting”, -“VersionUpgrading”, “Exposing”, “ExecuteDataScript”, “Backup”, “InstancesRebuilding”, “CustomOperation”.
+“VersionUpgrading”, “Exposing”, “Backup”, “InstancesRebuilding”, “CustomOperation”. @@ -12801,13 +12801,10 @@ If the cluster is not configured for dual-stack, the Service creation fails."Backup"
DataScriptType the data script operation will execute the data script against the cluster.
-"Custom"
RebuildInstance rebuilding an instance is very useful when a node is offline or an instance is unrecoverable.
"DataScript"
"Expose"
StartType the start operation will start the pods which is deleted in stop operation.
-(Appears on:ScriptSpec) -
-ScriptFrom specifies the source of the script to be executed, which can be either a ConfigMap or a Secret.
-Field | -Description | -
---|---|
-configMapRef - - -[]Kubernetes core/v1.ConfigMapKeySelector - - - |
-
-(Optional)
- A list of ConfigMapKeySelector objects, each specifies a ConfigMap and a key containing the script. -Note: This field cannot be modified once set. - |
-
-secretRef - - -[]Kubernetes core/v1.SecretKeySelector - - - |
-
-(Optional)
- A list of SecretKeySelector objects, each specifies a Secret and a key containing the script. -Note: This field cannot be modified once set. - |
-
-(Appears on:ScriptSpec) -
-ScriptSecret represents the secret that is used to execute the script.
-Field | -Description | -
---|---|
-name - -string - - |
-
- Specifies the name of the secret. - |
-
-usernameKey - -string - - |
-
-(Optional)
- Used to specify the username part of the secret. - |
-
-passwordKey - -string - - |
-
-(Optional)
- Used to specify the password part of the secret. - |
-
-(Appears on:SpecificOpsRequest) -
-ScriptSpec is a legacy feature for executing engine-specific operations such as creating databases or users. -It supports limited engines including MySQL, PostgreSQL, Redis, MongoDB.
-ScriptSpec has been replaced by the more versatile OpsDefinition. -It is recommended to use OpsDefinition instead. ScriptSpec is deprecated and will be removed in a future version.
-Field | -Description | -
---|---|
-ComponentOps - - -ComponentOps - - - |
-
-
-(Members of Specifies the name of the Component. - |
-
-image - -string - - |
-
-(Optional)
- Specifies the image to be used to execute scripts. -By default, the image “apecloud/kubeblocks-datascript:latest” is used. - |
-
-secret - - -ScriptSecret - - - |
-
-(Optional)
- Defines the secret to be used to execute the script. If not specified, the default cluster root credential secret is used. - |
-
-script - -[]string - - |
-
-(Optional)
- Defines the content of scripts to be executed. -All scripts specified in this field will be executed in the order they are provided. -Note: this field cannot be modified once set. - |
-
-scriptFrom - - -ScriptFrom - - - |
-
-(Optional)
- Specifies the sources of the scripts to be executed. -Each script can be imported either from a ConfigMap or a Secret. -All scripts obtained from the sources specified in this field will be executed after
-any scripts provided in the Execution order:
-1. Scripts provided in the Note: this field cannot be modified once set. - |
-
-selector - - -Kubernetes meta/v1.LabelSelector - - - |
-
-(Optional)
- Specifies the labels used to select the Pods on which the script should be executed. -By default, the script is executed on the Pod associated with the service named “{clusterName}-{componentName}”, -which typically routes to the Pod with the primary/leader role. -However, some Components, such as Redis, do not synchronize account information between primary and secondary Pods. -In these cases, the script must be executed on all replica Pods matching the selector. -Note: this field cannot be modified once set. - |
-
@@ -16937,24 +16714,6 @@ Reconfigure
scriptSpec
Specifies the image and scripts for executing engine-specific operations such as creating databases or users. -It supports limited engines including MySQL, PostgreSQL, Redis, MongoDB.
-ScriptSpec has been replaced by the more versatile OpsDefinition. -It is recommended to use OpsDefinition instead. -ScriptSpec is deprecated and will be removed in a future version.
-backup