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

refactor(flexvolume): simplify capabilities handling #51169

Merged
merged 1 commit into from
Aug 25, 2017

Conversation

mcluseau
Copy link
Contributor

@mcluseau mcluseau commented Aug 23, 2017

Simplify capabilities handling in FlexVolume.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 23, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @MikaelCluseau. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 23, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Aug 23, 2017
@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch from 8742b6e to b937208 Compare August 23, 2017 04:32
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 23, 2017
@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch from b937208 to bd9f099 Compare August 23, 2017 04:51
@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch from bd9f099 to 1c34107 Compare August 23, 2017 05:07
@thockin thockin assigned chakri-nelluri and unassigned thockin Aug 23, 2017
@thockin
Copy link
Member

thockin commented Aug 23, 2017

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 23, 2017
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2017
Copy link
Contributor

@chakri-nelluri chakri-nelluri left a comment

Choose a reason for hiding this comment

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

minor comment changes.

call := plugin.NewDriverCall(initCmd)
_, err := call.Run()
return err
// no-op, init in the FlexVolume API is not the same thing as VolumePlugin.Init()
Copy link
Contributor

Choose a reason for hiding this comment

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

*Nit - Rephrase and add, plugin already initialized during probe.

@@ -64,44 +65,25 @@ func NewFlexVolumePlugin(pluginDir, name string) (volume.VolumePlugin, error) {
unsupportedCommands: []string{},
}

// Check whether the plugin is attachable.
ok, err := isAttachable(flexPlugin)
call := flexPlugin.NewDriverCall(initCmd)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment. Initialize the plugin and probe the capabilities.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should make it very explicit that driver initialization is done when the plugin is instantiated, instead of during the VolumePlugin.Init() call like one might expect.

@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch 2 times, most recently from 3da79cb to 29a9a6b Compare August 24, 2017 03:36
@k8s-github-robot k8s-github-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-label-needed labels Aug 24, 2017
@mcluseau mcluseau changed the title feat(flexvolume): extend capabilities beyond attachable refactor(flexvolume): simplify capabilities handling Aug 24, 2017
@mcluseau
Copy link
Contributor Author

@chakri-nelluri @verult addressed the issues, added a test. PTAL :)

@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch from 29a9a6b to c2a8bd2 Compare August 24, 2017 03:51
@mcluseau mcluseau force-pushed the wip-flexvolume-caps branch from c2a8bd2 to 22d5e48 Compare August 24, 2017 11:19
@chakri-nelluri
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 24, 2017
@chakri-nelluri
Copy link
Contributor

/approve no-issue

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2017
@verult
Copy link
Contributor

verult commented Aug 24, 2017

/lgtm
/approve

@verult
Copy link
Contributor

verult commented Aug 24, 2017

/cc @TerraTech

@k8s-ci-robot
Copy link
Contributor

@verult: GitHub didn't allow me to request PR reviews from the following users: TerraTech.

Note that only kubernetes members can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @TerraTech

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.

@TerraTech
Copy link
Contributor

/lgtm I like that DriverCapabilities was promoted as that simplifies the flow by handling it directly during the unmarshalling.

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MikaelCluseau, TerraTech, chakri-nelluri, verult

Associated issue requirement bypassed by: chakri-nelluri

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@wongma7
Copy link
Contributor

wongma7 commented Aug 24, 2017

@mcluseau
Copy link
Contributor Author

@wongma7 what is failing? Why isn't it reported by the CI? I have "All checks have passed
11 successful checks", and the list includes e2e tests (like 6 ones).

@wongma7
Copy link
Contributor

wongma7 commented Aug 25, 2017

@MikaelCluseau it’s in the alpha suite so won’t block prs. They’re not meant to slow down alpha development, just there to make sure breaking changes are being made deliberately. the tests are really basic right now, but as we add more functionality to flex (namely dynamic installation), I think the e2es will become essential so i’d appreciate help maintaining them is all

@mcluseau
Copy link
Contributor Author

@wongma7 I completely agree, but I need to know where I can see if something is broken. Also, without at least an automated report, it's easy to forget to check. For instance, you had to provide links ;-) And they're not test log so it's hard to know what failed without having a way to rerun those tests myself.

@chakri-nelluri from static code analysis, I think this e2e is broken because it uses capabilities as the property name, and not Capabilities. I didn't change that to avoid a breaking change, but maybe we should do that since it was introduced on june 14th (in 894b9b2)

@wongma7
Copy link
Contributor

wongma7 commented Aug 25, 2017

@MikaelCluseau yeah, the workflow is not pleasant. Even if the tests did automatically run, the best they can do atm is give us a black/white failure that I will have to investigate: i.e. we have to check logs to see if the plugin init failed? or mount/attach callout? I will try to make them runnable on hack/local-up-cluster.sh so that they're more useful during development. So (for now) nobody should feel any obligation to help maintain, the best I can do is raise awareness and plea for help : p

In this particular case I'll be working on it today

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 46986, 51214, 51169, 50155, 51261)

@k8s-github-robot k8s-github-robot merged commit 2b28555 into kubernetes:master Aug 25, 2017
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants