-
Notifications
You must be signed in to change notification settings - Fork 217
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 more missing features from mock csi driver #269
Add more missing features from mock csi driver #269
Conversation
Hi @avalluri. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
68887e1
to
5fcc26d
Compare
pkg/hostpath/hostpath.go
Outdated
mutex sync.Mutex | ||
volumes map[string]hostPathVolume | ||
snapshots map[string]hostPathSnapshot | ||
capacity Capacity |
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.
Capacity must be protected by the mutex. That is no longer obvious.
Perhaps a better solution for it would be to have a read-only copy of the total capacity in config
and dynamically calculate the remaining capacity by substracting the size of all current volumes.
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 have another, older PR which also adds another parameter and partly fixed the capacity check: #253
Here's a proposal:
- I change how capacity is tracked in that PR.
- I add your config struct commit.
- I add my new value to it.
Once that is merged, you can rebase your 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.
Sounds good,, Once your PR is ready, I will rebase mine.
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 rest looks okay to me.
/test pull-kubernetes-csi-csi-driver-host-path-distributed-on-kubernetes-master |
I will check what caused the failure. |
I have a fix for the install issue in #253. The code itself probably also needed some of the changes there. |
/retest |
/test pull-kubernetes-csi-csi-driver-host-path-distributed-on-kubernetes-master |
cmd/hostpathplugin/main.go
Outdated
maxVolumesPerNode = flag.Int64("maxvolumespernode", 0, "limit of volumes per node") | ||
showVersion = flag.Bool("version", false, "Show version.") | ||
capacity = func() hostpath.Capacity { | ||
c := hostpath.Capacity{} |
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 initialization here must not get dropped. Dropping it causes a nil-map access when a parameter gets set.
#253 changes hostpath.Capacity
so that a nil pointer is okay.
fbaa9fb
to
2d4c721
Compare
Rebased on #253 |
/test pull-kubernetes-csi-csi-driver-host-path-distributed-on-kubernetes-master |
This is _on_ by default. If disabled, the driver does not add VOLUME_ACCESSIBILITY_CONSTRAINTS to its plugin capabilities and also does not add AccessibiilityTopology information for the volumes. This makes it possible to test some more code paths in external-provisioner.
It is _on_ default. When it is disabled, driver does not add RPC_EXPAND_VOLUME to its capabilities list. This is the feature supported by mock CSI driver.
2d4c721
to
6fe4041
Compare
/test pull-kubernetes-csi-csi-driver-host-path-distributed-on-kubernetes-master |
@avalluri: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
|
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 code is fine, but the release notes entry only reflects one of the four feature commits. Please also mention the other new options.
Updated the release notes with two other command-line options. |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avalluri, pohly 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 |
@@ -52,7 +52,9 @@ func main() { | |||
flag.Var(&cfg.Capacity, "capacity", "Simulate storage capacity. The parameter is <kind>=<quantity> where <kind> is the value of a 'kind' storage class parameter and <quantity> is the total amount of bytes for that kind. The flag may be used multiple times to configure different kinds.") | |||
flag.BoolVar(&cfg.EnableAttach, "enable-attach", false, "Enables RPC_PUBLISH_UNPUBLISH_VOLUME capability.") | |||
flag.Int64Var(&cfg.MaxVolumeSize, "max-volume-size", 1024*1024*1024*1024, "maximum size of volumes in bytes (inclusive)") | |||
|
|||
flag.BoolVar(&cfg.EnableTopology, "enable-topology", true, "Enables PluginCapability_Service_VOLUME_ACCESSIBILITY_CONSTRAINTS capability.") | |||
flag.BoolVar(&cfg.EnableVolumeExpansion, "node-expand-required", true, "Enables NodeServiceCapability_RPC_EXPAND_VOLUME capacity.") |
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 variable and configuration option is strangely named. It says "node-expand-required" but in truth, it controls entire volume expansion feature. I would like us to rename this.
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 haven't looked into it, but that sounds reasonable. Can you submit a PR?
What type of PR is this?
/kind feature
What this PR does / why we need it:
With the combination of #260, this enables in replacing the Mock CSI driver with host-path driver in Kubernetes E2E testing as described in #247.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
This PR is based on changes in #260.
Does this PR introduce a user-facing change?: