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

Continue provisioning deleted volumes #29

Merged
merged 4 commits into from
Feb 21, 2019

Conversation

jsafrane
Copy link
Contributor

CSI provisioner needs to return an error that means that provisioning may be in progress even when Provision() finished.

New ProvisionerExt interface is added that allows returning such status and provisioner controller will then continue trying to provision a volume until it either succeeds or some final error is received.

All this is optional, Provisioner interface is intact and its behavior is the same as before.

cc @msau42 @wongma7

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 11, 2019
@jsafrane
Copy link
Contributor Author

Related to kubernetes-csi/external-provisioner#131

@msau42
Copy link

msau42 commented Feb 11, 2019

/assign @wongma7
cc @lpabon

@wongma7
Copy link
Contributor

wongma7 commented Feb 19, 2019

lgtm, but linter is complaining

controller/volume.go:71:6:warning: exported type ProvisioningState should have comment or be unexported (golint)
controller/volume.go:74:2:warning: comment on exported const ProvisioningInBackground should be of the form "ProvisioningInBackground ..." (golint)
controller/volume.go:76:2:warning: comment on exported const ProvisioningFinished should be of the form "ProvisioningFinished ..." (golint)
controller/volume.go:78:2:warning: comment on exported const ProvisioningNoChange should be of the form "ProvisioningNoChange ..." (golint)

@jsafrane
Copy link
Contributor Author

Fixed lint. Please review controller/volume.go changes if the documentation is understandable.

}

// Prepare a claimRef to the claim early (to fail before a volume is
// provisioned)
claimRef, err := ref.GetReference(scheme.Scheme, claim)
if err != nil {
glog.Error(logOperation(operation, "unexpected error getting claim reference: %v", err))
return nil
return ProvisioningNoChange, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

y NoChange here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I don't know what previous ProvisionExt() returned. I know it's very unlikely that GetReference succeeded once, ProvisionExt() returned Background and second GetReference fails, but I prefer to be on the safer side.

@wongma7
Copy link
Contributor

wongma7 commented Feb 21, 2019

/lgtm
ty!!

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. 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. 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.

4 participants