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

✨ Support specifying VM images by ID or from Shared Image Gallery #291

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

justaugustus
Copy link
Member

@justaugustus justaugustus commented Oct 5, 2019

Signed-off-by: Stephen Augustus saugustus@vmware.com
Co-authored-by: Cecile Robert-Michon cerobert@microsoft.com

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Support specifying VM images by ID or from Shared Image Gallery

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/provider/azure Issues or PRs related to azure provider sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 5, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justaugustus

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:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2019
@justaugustus justaugustus force-pushed the image-ref branch 3 times, most recently from 46fac45 to 98ca47b Compare October 7, 2019 02:10
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2019
@justaugustus justaugustus force-pushed the image-ref branch 2 times, most recently from dc6260d to 63caf3c Compare October 7, 2019 03:17
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 7, 2019
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2019
@justaugustus justaugustus changed the title [WIP] Support multiple image types [WIP] ✨ Support specifying VM images by ID or from Shared Image Gallery Oct 7, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 7, 2019
@justaugustus justaugustus added this to the v0.3 milestone Oct 7, 2019
@justaugustus justaugustus changed the title [WIP] ✨ Support specifying VM images by ID or from Shared Image Gallery [WIP] sparkles Support specifying VM images by ID or from Shared Image Gallery Oct 7, 2019
@justaugustus justaugustus changed the title [WIP] sparkles Support specifying VM images by ID or from Shared Image Gallery [WIP] ✨ Support specifying VM images by ID or from Shared Image Gallery Oct 7, 2019
Offer string `json:"offer"`
SKU string `json:"sku"`
Version string `json:"version"`
Publisher *string `json:"publisher,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these fields optional? If not, the type should be string vs *string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juan-lee -- They're optional-ish. Only required when specifying a published image.

Here's what I wrote for the Image field, which I'm going to write a doc for in short order:

// Image defines information about the image to use for VM creation.
// There are three ways to specify an image: by ID, by publisher, or by Shared Image Gallery.
// If specifying an image by ID, only the ID field needs to be set.
// If specifying an image by publisher, the Publisher, Offer, SKU, and Version fields must be set.
// If specifying an image from a Shared Image Gallery, the SubscriptionID, ResourceGroup,
// Gallery, Name, and Version fields must be set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking out loud on how to make this more user friendly. This is where ObjectReference or claim style approach is nice. Each of those permutations could be expressed as a different type. Another option would be for image to have a type and use RuntimeExtension or a map.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justaugustus I filed issue #293 to track this improvement in the future.

@justaugustus
Copy link
Member Author

/assign @juan-lee @CecileRobertMichon @vincepri
/priority important-soon

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Oct 7, 2019
}

// generateImageID generates the resource ID for an image stored in an Azure Shared Image Gallery.
func generateImageID(image infrav1.Image) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to address in this PR, but we should probably enable webhook validation so clients can get errors right away instead of at reconcile time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juan-lee -- Would you mind opening an issue for webhook validation and linking back to this comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done #292

Copy link
Contributor

@juan-lee juan-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2019
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 7, 2019
There are now three ways to specify an image:
- by ID
- by publisher
- by Shared Image Gallery.

Usage:
- If specifying an image by ID, only the ID field needs to be set.
- If specifying an image by publisher, the Publisher, Offer, SKU,
   and Version fields must be set.
- If specifying an image from a Shared Image Gallery, the SubscriptionID,
   ResourceGroup, Gallery, Name, and Version fields must be set.

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
Co-authored-by: Cecile Robert-Michon <cerobert@microsoft.com>
Copy link
Contributor

@juan-lee juan-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2019
@justaugustus
Copy link
Member Author

I've removed the changes to the preKubeadmCommands, as we can't use them until we land image building: #270

They're in another branch, if anyone wants to see them.

@justaugustus justaugustus changed the title [WIP] ✨ Support specifying VM images by ID or from Shared Image Gallery ✨ Support specifying VM images by ID or from Shared Image Gallery Oct 7, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 7, 2019
@juan-lee
Copy link
Contributor

juan-lee commented Oct 7, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit 7f17ca1 into kubernetes-sigs:master Oct 7, 2019
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

csrwng pushed a commit to csrwng/cluster-api-provider-azure that referenced this pull request Jan 12, 2024
…ency-openshift-4.15-ose-azure-cluster-api-controllers

OCPBUGS-24091: Updating ose-azure-cluster-api-controllers-container image to be consistent with ART
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants