Skip to content

Commit

Permalink
fix: 修复cluster manager节点池更新问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Maclon9573 committed Sep 12, 2024
1 parent 49b8a7b commit e04e654
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ func (ga *GetAction) Handle(

func removeSensitiveInfo(group *cmproto.NodeGroup) *cmproto.NodeGroup {
if group != nil && group.LaunchTemplate != nil {
group.LaunchTemplate.InitLoginPassword = ""
if group.LaunchTemplate.InitLoginPassword != "" {
group.LaunchTemplate.InitLoginPassword = utils.RandomString(8)
}
if group.LaunchTemplate.KeyPair != nil {
if group.LaunchTemplate.KeyPair.KeyPublic != "" {
group.LaunchTemplate.KeyPair.KeyPublic = utils.RandomString(8)
}
group.LaunchTemplate.KeyPair.KeySecret = ""
group.LaunchTemplate.KeyPair.KeyPublic = ""
}
}
return group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ func (ng *NodeGroup) updateAgentPoolProperties(client api.AksService, cluster *p
// update agent pool
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
if _, err = client.UpdatePoolAndReturn(ctx, pool, "", cluster.SystemID, *pool.Name); err != nil {
if _, err = client.UpdatePoolAndReturn(ctx, pool, cloudprovider.GetClusterResourceGroup(cluster),
cluster.SystemID, *pool.Name); err != nil {
return errors.Wrapf(err, "UpdateNodeGroup: call UpdateAgentPool api failed")
}

Expand Down

0 comments on commit e04e654

Please sign in to comment.