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 tags to EFS resources. Update EFS Utils #309

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

kbasv
Copy link

@kbasv kbasv commented Jan 19, 2021

What is this PR about? / Why do we need it?

  • Allow adding tags to EFS resources to configure IAM policy condition based on tags.
  • Add default tags and provide a command line option to provide more tags.
  • Update RBAC permissions and efs-utils version.
  • Fixes Dynamic PV tests flaky #303

What testing is done?

Tested against my EKS cluster.

Ran make test-e2e on a fresh ec2 instance

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @kbasv. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 19, 2021
@wongma7
Copy link
Contributor

wongma7 commented Jan 26, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 26, 2021
@kbasv kbasv force-pushed the dpUpdate branch 2 times, most recently from 26e60d0 to 08368aa Compare January 27, 2021 17:32
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 27, 2021
@kbasv
Copy link
Author

kbasv commented Jan 27, 2021

/retest

3 similar comments
@kbasv
Copy link
Author

kbasv commented Jan 27, 2021

/retest

@kbasv
Copy link
Author

kbasv commented Jan 28, 2021

/retest

@wongma7
Copy link
Contributor

wongma7 commented Jan 28, 2021

/retest

cmd/main.go 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 Feb 3, 2021
@kbasv kbasv force-pushed the dpUpdate branch 2 times, most recently from 60ab06a to e8d8e1d Compare February 18, 2021 22:29
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2021
@kbasv
Copy link
Author

kbasv commented Feb 18, 2021

@wongma7 dynamic provisioning e2e tests passes now

@wongma7
Copy link
Contributor

wongma7 commented Mar 2, 2021

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kbasv, wongma7

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 2, 2021
@daisuke-yoshimoto
Copy link

@wongma7 @nckturner @kbasv
Is this PR not yet merged?

@daisuke-yoshimoto
Copy link

@wongma7 @nckturner @kbasv
Is there any update on this?

@wongma7
Copy link
Contributor

wongma7 commented Mar 10, 2021

coveralls is blocking. I guess it has a point this time, it wouldn't hurt for parsing functions to have some tests

func parseTagsFromStr(tagStr string) map[string]string {
defer func() {
if r := recover(); r != nil {
klog.Errorf("Failed to parse input tag string: %v", tagStr)
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add a unit test for this, using at least the same example in the command help text.

Instead of panicking and recovering given invalid input, let's check the length of p, this can be a test case as well.

Copy link
Author

Choose a reason for hiding this comment

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

I can add a test here.

The panicking and recovering is when there is a typo in the input or the key value pair is not of the form key:value. For example: key-value key;value

Copy link
Contributor

Choose a reason for hiding this comment

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

Checking for len would do the same thing but I guess it is a matter of style so it's fine. If len(p) is not 2, then the user must have made a typo like key-value or key:value:key etc.

I was thinking of just unit tests of parseTagsFromStr rather than "integration" test of all of CreateVolume but what you have added is fine

Copy link
Contributor

@wongma7 wongma7 Mar 10, 2021

Choose a reason for hiding this comment

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

Also WDYT about parsing at startup and fast failing instead of at createvolume time?

With current implementation, driver will startup and mount/unmount will still work but then all createvolumes will fail and the user will have to do debugging. Whereas if we fast fail they will presumably see the error message printed by the plugin

edit: never mind, I think it could be better to fail at createvolume time. Chasing logs of a crashlooping pod is not fun.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2021
…n based on tags.

* Add default tags and provide a command line option to provide more tags
* Update permissions and efs-utils version
Comment on lines +180 to +184
// mount access point
command := exec.Command("/bin/sh", "-c", "mount", "-t", "efs", "-o", "tls,accesspoint="+accessPointId, FileSystemId, target)
if err = command.Run(); err != nil {
framework.ExpectNoError(err, "Failed to mount using access point")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a test or setup step? If it's a test, shouldn't it be moved to a dedicated test method, rather than running in a BeforeSuite? If it's a setup, why did we delete the access point afterwards?

Copy link
Author

Choose a reason for hiding this comment

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

This is a setup step to bootstrap access points

Copy link
Contributor

Choose a reason for hiding this comment

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

do we expect users to do this? Do we need to document the need to bootstrap access points anywhere?

@wongma7
Copy link
Contributor

wongma7 commented Mar 10, 2021

One last question: what do yo uthink about making tags a storageclass parameter instead of a command line flag?

It is more flexible storageclass a could have its volumes tagged a certain way, b another way, and as a user I can more easijly audit both.

e: we can always add this later. I think for now, making it a flag satisfies most usecases

@kbasv
Copy link
Author

kbasv commented Mar 10, 2021

I like the idea of tags in the storage class parameters. We can eventually move it as a storage class parameter or we can do it now. I'm okay with either way

@wongma7
Copy link
Contributor

wongma7 commented Mar 11, 2021

/lgtm

I am really wary of the e2e test changes, I think we need to document, but in interest of gathering data let's merge it and see if it helps with the test flakiness

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit 3f7f71c into kubernetes-sigs:master Mar 12, 2021
@kbasv kbasv deleted the dpUpdate branch May 12, 2021 19:49
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Dynamic PV tests flaky
5 participants