Don't write populated IG state after editing IG

This commit is contained in:
Ole Markus With 2022-09-17 11:41:20 +02:00
parent 24d359ddc1
commit 4f2b5655bb
2 changed files with 4 additions and 13 deletions

View File

@ -157,7 +157,7 @@ func RunEditInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, o
return err return err
} }
failure, err := updateInstanceGroup(ctx, clientset, channel, cluster, oldGroup, newGroup) failure, err := updateInstanceGroup(ctx, clientset, channel, cluster, newGroup)
if err != nil { if err != nil {
return err return err
} }
@ -263,7 +263,7 @@ func RunEditInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, o
continue continue
} }
failure, err := updateInstanceGroup(ctx, clientset, channel, cluster, oldGroup, newGroup) failure, err := updateInstanceGroup(ctx, clientset, channel, cluster, newGroup)
if err != nil { if err != nil {
return preservedFile(err, file, out) return preservedFile(err, file, out)
} }
@ -280,7 +280,7 @@ func RunEditInstanceGroup(ctx context.Context, f *util.Factory, out io.Writer, o
} }
} }
func updateInstanceGroup(ctx context.Context, clientset simple.Clientset, channel *api.Channel, cluster *api.Cluster, oldGroup, newGroup *api.InstanceGroup) (string, error) { func updateInstanceGroup(ctx context.Context, clientset simple.Clientset, channel *api.Channel, cluster *api.Cluster, newGroup *api.InstanceGroup) (string, error) {
cloud, err := cloudup.BuildCloud(cluster) cloud, err := cloudup.BuildCloud(cluster)
if err != nil { if err != nil {
return "", err return "", err
@ -310,6 +310,6 @@ func updateInstanceGroup(ctx context.Context, clientset simple.Clientset, channe
} }
// Note we perform as much validation as we can, before writing a bad config // Note we perform as much validation as we can, before writing a bad config
_, err = clientset.InstanceGroupsFor(cluster).Update(ctx, fullGroup, metav1.UpdateOptions{}) _, err = clientset.InstanceGroupsFor(cluster).Update(ctx, newGroup, metav1.UpdateOptions{})
return "", err return "", err
} }

View File

@ -8,16 +8,7 @@ metadata:
name: nodes name: nodes
spec: spec:
image: ami-xyz image: ami-xyz
kubelet:
nodeLabels:
kubernetes.io/role: node
node-role.kubernetes.io/node: ""
taints:
- e2etest:NoSchedule
machineType: t2.medium
manager: CloudGroup
maxSize: 10 maxSize: 10
minSize: 2
role: Node role: Node
subnets: subnets:
- subnet-us-test-1a - subnet-us-test-1a