Skip to content

Commit 0459b5b

Browse files
jentingroboquat
authored andcommitted
kubecdl: filter the instance-type = control-plane
Add one more criteria to filter the control plane nodes only Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 84e1f36 commit 0459b5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dev/kubecdl/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func getNodeName(clusterName, project string) (nodeName, zone string, err error)
127127
Zone string `json:"zone"`
128128
}
129129

130-
out, err := exec.Command("gcloud", "compute", "instances", "list", "--format=json", "--quiet", "--project", project, "--filter", "labels.cluster-name>=ws-"+clusterName+" AND labels.cluster-name<=ws-"+clusterName).CombinedOutput()
130+
out, err := exec.Command("gcloud", "compute", "instances", "list", "--format=json", "--quiet", "--project", project, "--filter", "labels.cluster-name>=ws-"+clusterName+" AND labels.cluster-name<=ws-"+clusterName+" AND labels.instance-type>=control-plane AND labels.instance-type<=control-plane").CombinedOutput()
131131
if err != nil {
132132
return "", "", fmt.Errorf("failed to describe node instances: %s: %w", string(out), err)
133133
}

0 commit comments

Comments
 (0)