-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add ClassName attributes to PV and PVC #40013
Add ClassName attributes to PV and PVC #40013
Conversation
3ef7876
to
8c3ae5f
Compare
Not sure what this bazel error means:
|
Anyway, it's ready for review, cc: @kubernetes/sig-storage-misc. |
pkg/api/v1/types.go
Outdated
// Name of StorageClass where this persistent volume belongs. Empty value | ||
// means that this volume does not belong to any StorageClass. | ||
// +optional | ||
ClassName string `json:"className,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.
Should be storageClassName per conventions (assuming the resource kind is StorageClass):
cc @thockin
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 don't have a strong opinion here, I just follow pvc.Spec.VolumeName pattern (and not Spec.PersistentVolumeName)
pkg/api/v1/types.go
Outdated
// Name of the StorageClass where the desired volume belongs to. | ||
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1 | ||
// +optional | ||
ClassName *string `json:"className,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.
Why is this field a ptr and the previous one not?
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.
Because when PV.Spec.Class is missing it will default to empty string and hence it will be always filled. When PVC.Spec.Class is missing it means something else than empty string and we need to distinguish between these two cases.
8c3ae5f
to
97ae739
Compare
97ae739
to
15947d0
Compare
15947d0
to
54ed592
Compare
8ee3db5
to
d6c26f7
Compare
sorry about the Jenkins noise, updating API is tricky and fragile :-( |
6dd82a7
to
ae34140
Compare
ae34140
to
feb224f
Compare
@k8s-bot gce etcd3 e2e test this |
The only facet of this I am wrestling with is "storageClassName" vs "storageClass". Name is most precise and I guess precedented, it just feels verbose. |
/lgtm |
/approve |
shouldn't this get a release note? |
feb224f
to
dcb3e19
Compare
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: jsafrane, thockin Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
restoring lgtm after rebase |
Automatic merge from submit-queue |
This just adds new attributes to PV/PVC. Real code that uses the attributes instead of beta annotations will follow when we agree on the attribute names / style.