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

Validate Tags created for the resources #3398

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

VibhorChinda
Copy link
Contributor

@VibhorChinda VibhorChinda commented Apr 8, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR validates the tags created for resources

  1. Added code for checking max number of user tags which can be created for a resource [50 user tags can be created]
  2. Added code for checking characters which can be used in user tags created for a resource [letters, numbers, spaces and the following characters: _ . : / = + - @]

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # #1746

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Apr 8, 2022
@k8s-ci-robot
Copy link
Contributor

@VibhorChinda: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 8, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @VibhorChinda. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 8, 2022
@k8s-ci-robot k8s-ci-robot requested review from pydctw and shivi28 April 8, 2022 17:19
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 8, 2022
@VibhorChinda VibhorChinda changed the title [WIP] Validate Tags Validate Tags created for the resources Apr 9, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2022
@VibhorChinda
Copy link
Contributor Author

@richardcase please have a look :))

@VibhorChinda
Copy link
Contributor Author

tagging @sedefsavas @Ankitasw for allowing tests to run :))

@Ankitasw
Copy link
Member

/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 Apr 11, 2022
@VibhorChinda
Copy link
Contributor Author

All tests passed @Ankitasw :)))))

@richardcase
Copy link
Member

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

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.

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-eks
/test pull-cluster-api-provider-aws-e2e

@VibhorChinda
Copy link
Contributor Author

All tests passing @richardcase @Ankitasw @sedefsavas 👀

To the merge 🚀🚀 :))

Copy link
Member

@Ankitasw Ankitasw left a comment

Choose a reason for hiding this comment

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

As discussed in office hours, it would be good to add a small documentation about the tagging best practices, as we cannot handle that in our code.

api/v1beta1/tags.go Outdated Show resolved Hide resolved
api/v1beta1/tags.go Outdated Show resolved Hide resolved
@VibhorChinda
Copy link
Contributor Author

Makes sense @Ankitasw will do.

Could you please point to the place where I could add documentation :))

@Ankitasw
Copy link
Member

Could you please point to the place where I could add documentation :))

We have a doc where we list the conventions to be followed in code, I think we can add these changes here.

@k8s-ci-robot k8s-ci-robot removed the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 11, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 11, 2022
@VibhorChinda
Copy link
Contributor Author

Could you please point to the place where I could add documentation :))

We have a doc where we list the conventions to be followed in code, I think we can add these changes here.

@Ankitasw @richardcase I was wondering not to add any documentation/check for this. Because

If we say users should create tags with consistent naming convention and give examples like "costcenter" "CostCenter" etc

How would user be able to add characters in the naming thing ?? [As characters like "." "+" "-" "/" "@" etc are allowed and users can use them while naming tags.

What do you think ??

api/v1beta1/tags.go Outdated Show resolved Hide resolved
api/v1beta1/tags.go Outdated Show resolved Hide resolved
@sedefsavas
Copy link
Contributor

Could you please point to the place where I could add documentation :))

We have a doc where we list the conventions to be followed in code, I think we can add these changes here.

This doc is for development conventions. If we want to document this, either we need to create a new page for best practices or can update API comments with a note for following AWS best practices during tag naming. but IMO following AWS best practices suggestion is out of scope as long as we have checks in place to avoid erroneous behaviour.

@richardcase
Copy link
Member

@Ankitasw @richardcase I was wondering not to add any documentation/check for this. Because

If we say users should create tags with consistent naming convention and give examples like "costcenter" "CostCenter" etc

How would user be able to add characters in the naming thing ?? [As characters like "." "+" "-" "/" "@" etc are allowed and users can use them while naming tags.

What do you think ??

@VibhorChinda i would agree that we can stay away from the "best practice" part and leave that up to the user. So lets not add documentation around the costcentre vs CostCentre advice. I see that @sedefsavas has also left a comment with the same thoughts.

@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 Apr 13, 2022
@VibhorChinda
Copy link
Contributor Author

@richardcase @sedefsavas have a look please :))

@sedefsavas
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 Apr 14, 2022
@Ankitasw
Copy link
Member

/lgtm

@sedefsavas
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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 Apr 18, 2022
@k8s-ci-robot k8s-ci-robot merged commit f7023e9 into kubernetes-sigs:main Apr 18, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Apr 18, 2022
@VibhorChinda VibhorChinda deleted the ValidateTags branch April 18, 2022 17:11
@VibhorChinda
Copy link
Contributor Author

Yayyyyyyy :))
Onto the next 🚀🚀

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. 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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. 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.

5 participants