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 CloudLabels as --extra-tags to aws-ebs-csi driver #10976

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

codablock
Copy link
Contributor

This PR adds cloudLabels from the cluster spec as tags to EBS volumes created by the aws-ebs-csi driver. This allows us to fulfil company wide policies on tagging rules.

@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 Mar 4, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @codablock. 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.

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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/addons labels Mar 4, 2021
@@ -352,7 +352,7 @@ spec:
- --endpoint=$(CSI_ENDPOINT)
- --logtostderr
- --k8s-tag-cluster-id={{ ClusterName }}
- --extra-tags=KubernetesCluster={{ ClusterName }}
- --extra-tags=KubernetesCluster={{ ClusterName }},{{ CloudLabels }}
Copy link
Member

Choose a reason for hiding this comment

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

If cloudLabels is empty, will the trailing comma be a problem?

Copy link
Contributor Author

@codablock codablock Mar 4, 2021

Choose a reason for hiding this comment

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

That's what I'm verifying in exactly this moment as I realised this as well after re-reviewing the PR.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe you can add ClusterName to CloudLabels and will always be ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified: It works just fine with the trailing comma.

If still required, I can try to avoid that trailing comma. I checked if any ifs are used inside the templates and it looks like you've successfully avoided having any ifs/range, ... in the templates and I did not want to be the first one introducing it 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hakman That sounds good, but then I'd like to rename the CloudLabels template var as it does not resemble the cloudLabels from the cluster spec anymore. I'll call it "EbsCsiExtraTags" then.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename it to CsiExtraTags, to match the flag name.
This should be bumped to 0.8.0-kops.2 also:

Copy link
Member

Choose a reason for hiding this comment

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

I am good. We can always make the template functions more reusable later when there is need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hakman Fixed the name and bumped the version.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. Please also squash the commits and this should be it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@codablock codablock force-pushed the ebs-tags branch 4 times, most recently from 9777b9e to 599f19b Compare March 4, 2021 10:32
@hakman
Copy link
Member

hakman commented Mar 4, 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 Mar 4, 2021
@codablock
Copy link
Contributor Author

codablock commented Mar 4, 2021

I'm not sure what to do about the test failure...it seems unrelated.

EDIT: I tried the make gomod as suggested by the logs...but no changes.

@hakman
Copy link
Member

hakman commented Mar 4, 2021

It is related to Go 1.16 upgrade upstream. Don't worry.

@rifelpet
Copy link
Member

rifelpet commented Mar 4, 2021

/retest

@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, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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, 2021
@hakman
Copy link
Member

hakman commented Mar 5, 2021

/retest

1 similar comment
@hakman
Copy link
Member

hakman commented Mar 5, 2021

/retest

@k8s-ci-robot k8s-ci-robot merged commit 825d98f into kubernetes:master Mar 5, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 5, 2021
k8s-ci-robot added a commit that referenced this pull request Mar 5, 2021
…-upstream-release-1.20

Automated cherry pick of #10976: Add CloudLabels as --extra-tags to aws-ebs-csi driver
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. area/addons 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants