Skip to content

Commit

Permalink
mantle/ore: gcloud: fix error detection for deprecate-image
Browse files Browse the repository at this point in the history
Previously we weren't checking the error from "pending". Let's
do that now because we can miss actual errors from the gcloud API
otherwise.
  • Loading branch information
dustymabe committed May 15, 2020
1 parent c5e108b commit a131270
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mantle/cmd/ore/gcloud/deprecate-image.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ func runDeprecateImage(cmd *cobra.Command, args []string) {

plog.Debugf("Attempting to change GCP image deprecation state of %s to %s\n",
deprecateImageName, deprecateImageState)
_, err := api.DeprecateImage(deprecateImageName,
pending, err := api.DeprecateImage(deprecateImageName,
gcloud.DeprecationState(deprecateImageState), deprecateImageReplacement)
if err == nil {
err = pending.Wait()
}
if err != nil {
plog.Fatalf("Changing deprecation state of image failed: %v\n", err)
}
Expand Down

0 comments on commit a131270

Please sign in to comment.