-
Notifications
You must be signed in to change notification settings - Fork 32
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
Replace MutatorConfig with CreatePVCPrimeFn that allows custom creation of a PVC #201
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pwschuurman The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
68f8f8e
to
529d57b
Compare
if err != nil { | ||
c.recorder.Eventf(pvc, corev1.EventTypeWarning, reasonPVCPrimeMutatorError, "Failed to mutate populator pvcPrime: %s", err) | ||
if c.providerFunctionConfig != nil && c.providerFunctionConfig.CreatePVCPrimeFn != nil { | ||
if pvcPrime, err = c.providerFunctionConfig.CreatePVCPrimeFn(ctx, *params); err != nil { |
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.
The only thing I'm not sure about is that there is a check of "" == pvcPrime.Spec.VolumeName
[1]. Previous implementation was based on dynamic provisioning PV which will guarantee the check only get passed when the PVC' gets created. With CreatePVCPrimeFn
if there is a static provisioned PV, is it possible that pvcPrime.Spec.VolumeName
gets set, kubeClient.create.pvc' gets stuck for some reason, but the "" == pvcPrime.Spec.VolumeName
pass?
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.
That would be up to the client implementation. But, if the client uses static provisioning, the proper way to do this is to create a PV with a claimRef
, and then a PVC without a volumeName
set. The volume controller then binds the two, and sets volumeName
.
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.
It's a recommendation but not a requirement that users leave PVC.spec.volumeName unset.
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.
This flow probably should get added to the KEP or README later.
/retest |
/lgtm |
/cc @sunnylovestiramisu |
/retest |
What type of PR is this?
What this PR does / why we need it: This is a follow-up to #176. While useful, the previous approach of mutating a PVC prior to creation is not flexible enough for some providers. This enables some functionality for implementations to perform some custom steps prior to the create of a PVCPrime.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: