-
Notifications
You must be signed in to change notification settings - Fork 524
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
CFE-1047: Add the field "CapacityReservationGroupID" to "AzureMachineProviderSpec" in openshift/api #1866
CFE-1047: Add the field "CapacityReservationGroupID" to "AzureMachineProviderSpec" in openshift/api #1866
Conversation
@anirudhAgniRedhat: This pull request references CFE-1046 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the spike to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Hello @anirudhAgniRedhat! Some important instructions when contributing to openshift/api: |
@anirudhAgniRedhat: This pull request references CFE-1047 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
// used for allocating the virtual machine. | ||
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="CapacityReservationGroupID is immutable once set" | ||
// +optional | ||
CapacityReservationGroupID string `json:"capacityReservationGroupID,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the format of the reservation group ID? What characters are valid? What is the minimal and maximal length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoelSpeed I found this is the format for Capacity reservation Group ID
I guess resourceGroupName and CapacityReservationGroupName may vary on differen Users.
subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/<CapacityReservationGroupName>
Also didn't found maximum and minimum length for ID in AzureDocs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the upstream implementation, there is a validation implemented via a webhook, can you explain what that validation is doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err := webhookutils.ValidateImmutable(
field.NewPath("spec", "capacityReservationGroupID"),
old.Spec.CapacityReservationGroupID,
m.Spec.CapacityReservationGroupID); err != nil {
allErrs = append(allErrs, err)
}
this insures that the field is immutable and cannot be updated once set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a validation that it is a valid azure ID no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is a validation on pattern, that the input must be string having length more than 0,
Also the string should start with "/".
The keys which are used should be among "subscriptions", "providers" and "resourcegroups" following by valid ID or names respectively.
the ideal format for ID is /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/<CapacityReservationGroupName>
I did not find check that the input provided is valid ID. It Just checks for the format of the input provided, does not insure the IDs or names provides are correct.
@JoelSpeed I have added the commit to call out validations in doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so I think we want to use the ParseResourceID
as well, but, for that to pass, I need to understand, as an end user, what a valid input is. So, I'd like to have some text that explains what a valid input to that validation is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you've updated the description, looks good
/retest-required |
@anirudhAgniRedhat: This pull request references CFE-1047 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@anirudhAgniRedhat Do you have an implementation for this API that's ready to merge shortly after? |
@JoelSpeed I will start working on its implementation from now onwards as we merge this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoelSpeed do these nits look good to be added?
Yeah lets get those added Also, since we are close to the feature freeze date, I'd like to see the feature tested end to end by QE before we merge the API, else we risk shipping an API in one release with no implementation. Please link a WIP PR here once you have it |
Sure @JoelSpeed |
@JoelSpeed This is WIP PR for its implementation openshift/machine-api-provider-azure#107 |
// It is optional but may not be changed once set. | ||
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="CapacityReservationGroupID is immutable once set" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop these, they won't be able to be implemented within MAPI
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
Signed-off-by: anirudhAgniRedhat <aagnihot@redhat.com>
daa4568
to
d551387
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anirudhAgniRedhat, 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 |
@JoelSpeed The PR require |
Considering proximity to the release branch cut off, and the fact that TRT have had to introduce the critical fixes requirement. I'm inclined to say we should slip this feature to 4.17, do you see that causing an issue? |
As this feature is anyway planed for 4.17, we should be good. |
/cherrypick release-4.16 |
@anirudhAgniRedhat: new pull request created: #1923 In response to this:
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-sigs/prow repository. |
/cherrypick release-4.15 |
/cherrypick release-4.14 |
@anirudhAgniRedhat: #1866 failed to apply on top of branch "release-4.15":
In response to this:
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-sigs/prow repository. |
@anirudhAgniRedhat: #1866 failed to apply on top of branch "release-4.14":
In response to this:
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-sigs/prow repository. |
This PR adds the support of capacity reservation group in
AzureMachineProviderSpec
. A new field,CapacityReservationGroupID
, is added. This ID is used while creating the corresponding Azure VM and the VM is added to the capacity reservation group.The capacity reservation group should already exist. Once the VM is created and associated to the capacity reservation group it cannot be removed from the group. Similarly, if a VM is created without any association to a capacity reservation group then it cannot be associated to one later on. Thus,
CapacityReservationGroupID
field is made immutable.