You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/01/19 15:56:33 UTC

[shardingsphere-on-cloud] branch main updated: fix: fix extra container port

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shardingsphere-on-cloud.git


The following commit(s) were added to refs/heads/main by this push:
     new 4ec6fbc  fix: fix extra container port
     new 55f1c6b  Merge pull request #185 from mlycore/fix-port
4ec6fbc is described below

commit 4ec6fbc6110d6d6b5145578f0e261713b2083dda
Author: mlycore <ma...@126.com>
AuthorDate: Thu Jan 19 23:52:01 2023 +0800

    fix: fix extra container port
    
    Signed-off-by: mlycore <ma...@126.com>
---
 shardingsphere-operator/pkg/reconcile/computenode/deployment.go | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/shardingsphere-operator/pkg/reconcile/computenode/deployment.go b/shardingsphere-operator/pkg/reconcile/computenode/deployment.go
index 5e58040..83c775a 100644
--- a/shardingsphere-operator/pkg/reconcile/computenode/deployment.go
+++ b/shardingsphere-operator/pkg/reconcile/computenode/deployment.go
@@ -44,9 +44,8 @@ func ComputeNodeNewDeployment(cn *v1alpha1.ComputeNode) *v1.Deployment {
 	deploy.Spec.Replicas = &cn.Spec.Replicas
 	deploy.Spec.Template.Labels = cn.Labels
 	deploy.Spec.Template.Spec.Containers[0].Image = fmt.Sprintf("%s:%s", imageName, cn.Spec.ServerVersion)
-	if deploy.Spec.Template.Spec.Containers[0].Ports == nil {
-		deploy.Spec.Template.Spec.Containers[0].Ports = []corev1.ContainerPort{}
-	}
+
+	deploy.Spec.Template.Spec.Containers[0].Ports = []corev1.ContainerPort{}
 	for _, pb := range cn.Spec.PortBindings {
 		deploy.Spec.Template.Spec.Containers[0].Ports = append(deploy.Spec.Template.Spec.Containers[0].Ports, corev1.ContainerPort{
 			Name:          pb.Name,