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

Add generic DataSource feature gate #88636

Merged
merged 1 commit into from Mar 5, 2020

Conversation

bswartz
Copy link
Contributor

@bswartz bswartz commented Feb 27, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:

Allow any custom resource to be the data source of a PVC.

This is an alpha feature enabled by the GenericPVCDataSource feature gate.

Which issue(s) this PR fixes:

Fixes #88635

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Added GenericPVCDataSource feature gate to enable using arbitrary custom resources as the data source for a PVC.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

[KEP]: https://github.com/kubernetes/enhancements/commit/933a044fa4efc137cd6a6479c96cbf627a4e92cc

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 27, 2020
@bswartz
Copy link
Contributor Author

bswartz commented Feb 27, 2020

/sig storage
/assign saad-ali

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 27, 2020
@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Feb 27, 2020
@msau42
Copy link
Member

msau42 commented Mar 2, 2020

/assign @msau42 @j-griffith

@msau42
Copy link
Member

msau42 commented Mar 2, 2020

@kubernetes/sig-storage-api-reviews

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Mar 2, 2020
@msau42
Copy link
Member

msau42 commented Mar 2, 2020

/assign @xing-yang

@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@msau42
Copy link
Member

msau42 commented Mar 2, 2020

/label api-review

@k8s-ci-robot k8s-ci-robot added the api-review Categorizes an issue or PR as actively needing an API review. label Mar 2, 2020
@msau42
Copy link
Member

msau42 commented Mar 2, 2020

/assign @thockin

Copy link
Contributor

@j-griffith j-griffith left a comment

Choose a reason for hiding this comment

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

I think there are some details missing here, you'll at least need to address:

  1. What happens if this new "open it all up" feature is enabled but SnapshotDataSource is not?
  2. The godocs in types.go needs to be updated

pkg/features/kube_features.go Outdated Show resolved Hide resolved
pkg/api/persistentvolumeclaim/util_test.go Show resolved Hide resolved
Copy link
Contributor

@j-griffith j-griffith left a comment

Choose a reason for hiding this comment

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

If others are "ok" with the level of testing that's fine; The doc additions however have to be added.

pkg/features/kube_features.go Outdated Show resolved Hide resolved
@bswartz
Copy link
Contributor Author

bswartz commented Mar 4, 2020

/retest

Copy link
Contributor

@j-griffith j-griffith left a comment

Choose a reason for hiding this comment

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

Minor suggesting to fix up the docstring in types.go. I think you also need to update the copy in staging/src/k8s.io/api/core/v1/types.go

pkg/apis/core/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 4, 2020
Copy link
Member

@msau42 msau42 left a comment

Choose a reason for hiding this comment

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

Generally lgtm, just some minor nits on the comment.

Can you rebase and squash?

// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta)
// * An existing PVC (PersistentVolumeClaim)
// * An existing custom resource/object that implements data population (Alpha)
// In order to use VolumeSnapshot object types, the appropriate feature gate
Copy link
Member

Choose a reason for hiding this comment

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

Do we also need to talk about the cloning case?

// If the provisioner does not support the specified data source, the volume will
// This field can be used to specify either:
// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta)
// * An existing PVC (PersistentVolumeClaim)
Copy link
Member

Choose a reason for hiding this comment

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

@j-griffith do you plan on updating alpha-beta designation for cloning in your PR?

Copy link
Member

Choose a reason for hiding this comment

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

I see cloning is GA now.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 4, 2020
@bswartz
Copy link
Contributor Author

bswartz commented Mar 4, 2020

I rebased, no squash yet. Let me do that now.

@bswartz bswartz force-pushed the generic-datasource branch 2 times, most recently from 05f880f to 091978f Compare March 4, 2020 22:32
@bswartz
Copy link
Contributor Author

bswartz commented Mar 4, 2020

Had to push one more time to remove test cases where PVC cloning feature gate was disabled. It's squashed now.

@msau42
Copy link
Member

msau42 commented Mar 4, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2020
@bswartz
Copy link
Contributor Author

bswartz commented Mar 4, 2020

/retest

Allow any custom resource to be the data source of a PVC, if the
AnyVolumeDataSource feature gate is enabled. This is an alpha feature.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2020
@bswartz
Copy link
Contributor Author

bswartz commented Mar 4, 2020

@msau42 I had to push another commit to add these 3 files generated by "make update":

api/openapi-spec/swagger.json
staging/src/k8s.io/api/core/v1/generated.proto
staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go

@msau42
Copy link
Member

msau42 commented Mar 5, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 5, 2020
@thockin
Copy link
Member

thockin commented Mar 5, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bswartz, thockin

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 5, 2020
@bswartz
Copy link
Contributor Author

bswartz commented Mar 5, 2020

/retest

@k8s-ci-robot k8s-ci-robot merged commit 59c6d33 into kubernetes:master Mar 5, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 5, 2020
@bswartz bswartz deleted the generic-datasource branch March 5, 2020 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. 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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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.

Allow generic data sources
8 participants