From b82f6b82825ca30035030ba9aba7820366f0792a Mon Sep 17 00:00:00 2001 From: liu-657627 <837397251@qq.com> Date: Tue, 19 Sep 2023 21:24:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?replicas=20=3D=20-1=20=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E7=AD=89=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module-controller/api/v1alpha1/moduledeployment_types.go | 4 +--- .../crd/bases/serverless.alipay.com_moduledeployments.yaml | 7 +------ .../module-deployment_v1alpha1_moduledeployment.yaml | 1 - .../controller/moduledeployment_controller_suit_test.go | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/module-controller/api/v1alpha1/moduledeployment_types.go b/module-controller/api/v1alpha1/moduledeployment_types.go index 2e3107b7e..7544b4cce 100644 --- a/module-controller/api/v1alpha1/moduledeployment_types.go +++ b/module-controller/api/v1alpha1/moduledeployment_types.go @@ -127,9 +127,7 @@ type ModuleDeploymentSpec struct { Template ModuleTemplateSpec `json:"template,omitempty"` - // +kubebuilder:validation:Enum={"symmetric","asymmetric"} - DeployType DeployType `json:"deployType"` - + // +kubebuilder:validation:Minimum=-1 Replicas int32 `json:"replicas,omitempty"` MinReadySeconds int32 `json:"minReadySeconds,omitempty"` diff --git a/module-controller/config/crd/bases/serverless.alipay.com_moduledeployments.yaml b/module-controller/config/crd/bases/serverless.alipay.com_moduledeployments.yaml index 241808a2d..a11b50b29 100644 --- a/module-controller/config/crd/bases/serverless.alipay.com_moduledeployments.yaml +++ b/module-controller/config/crd/bases/serverless.alipay.com_moduledeployments.yaml @@ -39,11 +39,6 @@ spec: Important: Run "make" to regenerate code after modifying this file' minLength: 1 type: string - deployType: - enum: - - symmetric - - asymmetric - type: string minReadySeconds: format: int32 type: integer @@ -56,6 +51,7 @@ spec: type: integer replicas: format: int32 + minimum: -1 type: integer revisionHistoryLimit: format: int32 @@ -175,7 +171,6 @@ spec: type: object required: - baseDeploymentName - - deployType type: object status: description: ModuleDeploymentStatus defines the observed state of ModuleDeployment diff --git a/module-controller/config/samples/module-deployment_v1alpha1_moduledeployment.yaml b/module-controller/config/samples/module-deployment_v1alpha1_moduledeployment.yaml index beb80e94e..ebd25c93c 100644 --- a/module-controller/config/samples/module-deployment_v1alpha1_moduledeployment.yaml +++ b/module-controller/config/samples/module-deployment_v1alpha1_moduledeployment.yaml @@ -16,7 +16,6 @@ spec: name: dynamic-provider version: '1.0.0' url: http://serverless-opensource.oss-cn-shanghai.aliyuncs.com/module-packages/stable/dynamic-provider-1.0.0-ark-biz.jar - deployType: symmetric replicas: 1 strategy: upgradeType: installAndUninstall diff --git a/module-controller/internal/controller/moduledeployment_controller_suit_test.go b/module-controller/internal/controller/moduledeployment_controller_suit_test.go index 77a04a177..168c791e4 100644 --- a/module-controller/internal/controller/moduledeployment_controller_suit_test.go +++ b/module-controller/internal/controller/moduledeployment_controller_suit_test.go @@ -5,7 +5,6 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/sofastack/sofa-serverless/api/v1alpha1" - moduledeploymentv1alpha1 "github.com/sofastack/sofa-serverless/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -98,7 +97,6 @@ func prepareModuleDeployment(namespace, moduleDeploymentName string) v1alpha1.Mo moduleDeployment := v1alpha1.ModuleDeployment{ Spec: v1alpha1.ModuleDeploymentSpec{ BaseDeploymentName: baseDeploymentName, - DeployType: moduledeploymentv1alpha1.ModuleDeploymentDeployTypeSymmetric, Template: v1alpha1.ModuleTemplateSpec{ Spec: v1alpha1.ModuleSpec{ Module: v1alpha1.ModuleInfo{ From 123c4245d559f24dd456aff1a131ae1b68da2d99 Mon Sep 17 00:00:00 2001 From: liu-657627 <837397251@qq.com> Date: Tue, 19 Sep 2023 22:13:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A7=BB=E9=99=A4DeployType=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module-controller/api/v1alpha1/moduledeployment_types.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/module-controller/api/v1alpha1/moduledeployment_types.go b/module-controller/api/v1alpha1/moduledeployment_types.go index 7544b4cce..679db3ce1 100644 --- a/module-controller/api/v1alpha1/moduledeployment_types.go +++ b/module-controller/api/v1alpha1/moduledeployment_types.go @@ -51,13 +51,6 @@ const ( CafeDeploymentReleaseProgressTermed ReleaseProgress = "Terminated" ) -type DeployType string - -const ( - ModuleDeploymentDeployTypeSymmetric DeployType = "symmetric" - ModuleDeploymentDeployTypeAsymmetric DeployType = "asymmetric" -) - type ModuleSchedulingType string const (