You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error occurred when executing stop. * googleapi: Error 400: Labels could not be set due to fingerprint mismatch; try again with the proper fingerprint: incorrect fingerprint supplied was "", the expected one is "1f7027a2"., failedPrecondition
To Reproduce
When {"command": "stop"} is published in Pub/Sub.
Known workaround
Modify the code.
operator/gke.go
func SetLabelNodePoolSize(ctx context.Context, projectID string, targetLabel string) error {
s, err := container.NewService(ctx)
if err != nil {
return err
}
// get all clusters list
clusters, err := container.NewProjectsLocationsClustersService(s).List("projects/" + projectID + "/locations/-").Do()
if err != nil {
return err
}
// filtering with target label
for _, cluster := range filter(clusters.Clusters, targetLabel, "true") {
labels := cluster.ResourceLabels
fingerprint := cluster.LabelFingerprint //add
for _, nodePool := range cluster.NodePools {
nodeSizeLabel := "restore-size-" + nodePool.Name
labels[nodeSizeLabel] = strconv.FormatInt(nodePool.InitialNodeCount, 10)
}
parseRegion := strings.Split(cluster.Location, "/")
region := parseRegion[len(parseRegion)-1]
name := "projects/" + projectID + "/locations/" + region + "/clusters/" + cluster.Name
req := &container.SetLabelsRequest{
ResourceLabels: labels,
LabelFingerprint: fingerprint, //add
}
_, err := container.NewProjectsLocationsClustersService(s).SetResourceLabels(name, req).Do()
if err != nil {
return err
}
}
return nil
}
The text was updated successfully, but these errors were encountered:
Describe the bug
The following error occurred when executing stop.
* googleapi: Error 400: Labels could not be set due to fingerprint mismatch; try again with the proper fingerprint: incorrect fingerprint supplied was "", the expected one is "1f7027a2"., failedPrecondition
To Reproduce
When {"command": "stop"} is published in Pub/Sub.
Known workaround
Modify the code.
operator/gke.go
The text was updated successfully, but these errors were encountered: