Skip to content

Commit

Permalink
feature(main): using up and down interface
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <cuisongliu@qq.com>
  • Loading branch information
cuisongliu committed Aug 21, 2023
1 parent 308e9f8 commit 66ec411
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func (k *KubeadmRuntime) Reset() error {
return k.reset()
}
func (k *KubeadmRuntime) ScaleUp(newMasterIPList []string, newNodeIPList []string) error {
if newMasterIPList != nil && len(newMasterIPList) != 0 {
if len(newMasterIPList) != 0 {
logger.Info("%s will be added as master", newMasterIPList)
if err := k.joinMasters(newMasterIPList); err != nil {
return err
}
}
if newNodeIPList != nil && len(newNodeIPList) != 0 {
if len(newNodeIPList) != 0 {
logger.Info("%s will be added as worker", newNodeIPList)
if err := k.joinNodes(newNodeIPList); err != nil {
return err
Expand All @@ -111,13 +111,13 @@ func (k *KubeadmRuntime) ScaleUp(newMasterIPList []string, newNodeIPList []strin
}

func (k *KubeadmRuntime) ScaleDown(deleteMastersIPList []string, deleteNodesIPList []string) error {
if deleteMastersIPList != nil && len(deleteMastersIPList) != 0 {
if len(deleteMastersIPList) != 0 {
logger.Info("master %s will be deleted", deleteMastersIPList)
if err := k.deleteMasters(deleteMastersIPList); err != nil {
return err
}
}
if deleteNodesIPList != nil && len(deleteNodesIPList) != 0 {
if len(deleteNodesIPList) != 0 {
logger.Info("worker %s will be deleted", deleteNodesIPList)
return k.deleteNodes(deleteNodesIPList)
}
Expand Down

0 comments on commit 66ec411

Please sign in to comment.