From 047dd705fd5c46c5e4e831c9cc0913269939b26b Mon Sep 17 00:00:00 2001 From: yangxg Date: Wed, 31 Jul 2024 18:46:18 +0800 Subject: [PATCH 1/2] fix: failed to delete node by apply Signed-off-by: yangxg --- pkg/apply/applydrivers/apply_drivers_default.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/apply/applydrivers/apply_drivers_default.go b/pkg/apply/applydrivers/apply_drivers_default.go index df70864515a..97a181f1a17 100644 --- a/pkg/apply/applydrivers/apply_drivers_default.go +++ b/pkg/apply/applydrivers/apply_drivers_default.go @@ -228,7 +228,10 @@ func (c *Applier) scaleCluster(mj, md, nj, nd []string) error { logger.Info("start to scale this cluster") logger.Debug("current cluster: master %s, worker %s", c.ClusterCurrent.GetMasterIPAndPortList(), c.ClusterCurrent.GetNodeIPAndPortList()) logger.Debug("desired cluster: master %s, worker %s", c.ClusterDesired.GetMasterIPAndPortList(), c.ClusterDesired.GetNodeIPAndPortList()) - scaleProcessor, err := processor.NewScaleProcessor(c.ClusterFile, c.ClusterDesired.Name, c.ClusterDesired.Spec.Image, mj, md, nj, nd) + + localpath := constants.Clusterfile(c.ClusterDesired.Name) + cf := clusterfile.NewClusterFile(localpath) + scaleProcessor, err := processor.NewScaleProcessor(cf, c.ClusterDesired.Name, c.ClusterDesired.Spec.Image, mj, md, nj, nd) if err != nil { return err } From a232a69c65ad21c1fbe1255e5b84db875832798e Mon Sep 17 00:00:00 2001 From: yangxg Date: Fri, 20 Sep 2024 19:53:58 +0800 Subject: [PATCH 2/2] file format: gofmt -s -w pkg/apply/applydrivers/apply_drivers_default.go Signed-off-by: yangxg --- pkg/apply/applydrivers/apply_drivers_default.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apply/applydrivers/apply_drivers_default.go b/pkg/apply/applydrivers/apply_drivers_default.go index 97a181f1a17..641aeec93f5 100644 --- a/pkg/apply/applydrivers/apply_drivers_default.go +++ b/pkg/apply/applydrivers/apply_drivers_default.go @@ -228,7 +228,7 @@ func (c *Applier) scaleCluster(mj, md, nj, nd []string) error { logger.Info("start to scale this cluster") logger.Debug("current cluster: master %s, worker %s", c.ClusterCurrent.GetMasterIPAndPortList(), c.ClusterCurrent.GetNodeIPAndPortList()) logger.Debug("desired cluster: master %s, worker %s", c.ClusterDesired.GetMasterIPAndPortList(), c.ClusterDesired.GetNodeIPAndPortList()) - + localpath := constants.Clusterfile(c.ClusterDesired.Name) cf := clusterfile.NewClusterFile(localpath) scaleProcessor, err := processor.NewScaleProcessor(cf, c.ClusterDesired.Name, c.ClusterDesired.Spec.Image, mj, md, nj, nd)