Skip to content

Conversation

@patrickdillon
Copy link

VMs created from images in the marketplace or shared galleries may require purchase plans. This adds logic to pass through specified plan data when appropriate.

Simplified version of this upstream logic: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/d2b4e8ed2313adc270a0911d9d0c64e344f34cc4/azure/services/virtualmachines/virtualmachines.go#L259-L287

/hold
Depends on openshift/api#1057

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 16, 2021
@openshift-ci openshift-ci bot requested review from JoelSpeed and enxebre November 16, 2021 16:06
if image.Publisher == "" || image.SKU == "" || image.Offer == "" {
return nil

Choose a reason for hiding this comment

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

Do we care about the version? IIRC the upstream implementation cared about versions and put those into the plan? I could be mistaken though

Copy link
Author

Choose a reason for hiding this comment

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

Comment on lines 95 to 111
{
name: "Non-ThirdParty Marketplace Image",
updateSpec: nil,
validate: func(g *WithT, vm *compute.VirtualMachine) {
g.Expect(vm.Plan).To(BeNil())
},
},
{
name: "ThirdParty Marketplace Image",
updateSpec: func(vmSpec *Spec) {
vmSpec.Image.ThirdPartyImage = true
},
validate: func(g *WithT, vm *compute.VirtualMachine) {
g.Expect(vm.Plan).ToNot(BeNil())

},
},

Choose a reason for hiding this comment

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

Should we add a ShareImageGallery test as well?

Copy link
Author

Choose a reason for hiding this comment

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

Just removed support for Image Galleries from the API. Apparently we are only doing marketplace images.

@patrickdillon patrickdillon force-pushed the azure-marketplace branch 3 times, most recently from 2657e50 to 9d81790 Compare November 18, 2021 22:05
@patrickdillon patrickdillon changed the title [WIP] Add VM Support for Marketplace Purchase Plans Add VM Support for Marketplace Purchase Plans Nov 19, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 19, 2021
@patrickdillon
Copy link
Author

/hold cancel
openshift/api#1057 merged

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 19, 2021
VMs created from images in the marketplace or shared galleries
may require purchase plans. This adds logic to pass through specified
plan data when appropriate.
New image type field in the machine provider spec.
Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/approve

@JoelSpeed
Copy link

/retest

@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2021
Copy link

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2021
@openshift-merge-robot openshift-merge-robot merged commit 6cf23a6 into openshift:master Nov 22, 2021
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants