Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcp: allow for deprecating and then attaching to image family #1444

Merged
merged 5 commits into from
May 15, 2020

Conversation

dustymabe
Copy link
Member

@dustymabe dustymabe commented May 11, 2020

Currently we create an image and attach it to an image family in a single API call. We'd like to attach it to an image family after the image has been deprecated (deprecated images won't be given to users who are trying to retrieve the latest image for an image family). However, you can't create an image AND deprecate it in the same API call so there is a split second of opportunity for a user to get the newer GCP image before we've officially released it.

This change breaks it up so that we can:

  1. create the image (not part of a image family)
  2. deprecate the image
  3. attach the image to an image family

The new flow means there is no opportunity for a user to get an image that has yet to be released.

This builds on top of #1435 in anticipation of it merging first. See individual commit messages for more details.

@dustymabe dustymabe changed the title Dusty ore gcloud update image gcp: allow for deprecating and then attaching to image family May 11, 2020
@openshift-ci-robot
Copy link

@dustymabe: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/sanity 9667151 link /test sanity

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@dustymabe
Copy link
Member Author

dustymabe commented May 12, 2020

OK I've tested this now and it's working well. Leaving in draft mode until #1435 is merged.

mantle/cmd/ore/gcloud/update-image.go Outdated Show resolved Hide resolved
mantle/cmd/ore/gcloud/update-image.go Outdated Show resolved Hide resolved
mantle/platform/api/gcloud/image.go Outdated Show resolved Hide resolved
mantle/platform/api/gcloud/image.go Outdated Show resolved Hide resolved
mantle/cmd/ore/gcloud/deprecate-image.go Outdated Show resolved Hide resolved
@dustymabe dustymabe force-pushed the dusty-ore-gcloud-update-image branch from 0ce11a9 to a7812be Compare May 14, 2020 22:33
@dustymabe dustymabe marked this pull request as ready for review May 14, 2020 22:33
@dustymabe
Copy link
Member Author

ok I'm marking this as ready for review as it's no longer blocking on any other work. Regarding #1444 (comment) (using the same API call to also deprecate) I tried really hard to make this happen but I could not get it to work (see WIP in dustymabe@9f5cf34). I reached out to our contacts at google to see if there is an existing bug. Being that it is the alpha API it's possible. For now I suggest we go with what we have here.

@dustymabe dustymabe force-pushed the dusty-ore-gcloud-update-image branch from a7812be to eb92096 Compare May 14, 2020 22:39
This was passing through the toplevel opts.Image processing
before and it was creating a URL for the image rather than
just the string passed by the user. Override it here.
This is prep for some future work where we need the images.patch
API call. That API call is currently only in the alpha API.

Note: ran `go mod vendor` to pick up the alpha API files.
This new command will take advantage of the new Alpha compute API
call to image.patch that will allow us to update the image family
for an image after it has been created. The image.patch API call
also allows for updating the description (which we also allow here)
and the deprecation state (which we leave to the deprecate-image
command).
Currently we create an image and attach it to an image family in a
single API call. We'd like to attach it to an image family *after*
the image has been deprecated (deprecated images won't be given
to users who are trying to retrieve the latest image for an image
family). However, you can't create an image AND deprecate it in
the same API call so there is a split second of opportunity for
a user to get the newer GCP image before we've officially released
it.

This change breaks it up so that we can:

1. create the image (not part of a image family)
2. deprecate the image
3. attach the image to an image family

The new flow means there is no opportunity for a user to get an
image that has yet to be released.
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.
@dustymabe dustymabe force-pushed the dusty-ore-gcloud-update-image branch from eb92096 to d0e6380 Compare May 15, 2020 16:53
@dustymabe
Copy link
Member Author

Ok I think I've resolved all outstanding requests and/or answered outstanding questions. Care to do a final round of review?

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arithx, bgilbert, dustymabe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [arithx,bgilbert,dustymabe]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@arithx
Copy link
Contributor

arithx commented May 15, 2020

/lgtm

@dustymabe
Copy link
Member Author

ok CI passed, but prow is MIA - merging.

@dustymabe dustymabe merged commit a131270 into coreos:master May 15, 2020
@dustymabe dustymabe deleted the dusty-ore-gcloud-update-image branch May 15, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants