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: move list of allowed ResourceTemplate types to its own package #1068

Merged
merged 1 commit into from
May 4, 2021

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Apr 23, 2021

Changes

This will help reduce the number of places we keep track of the list of
types that Triggers can create especially as we add the v1beta1 types.

Partially addresses #494 and part of the work needed for #1067

/kind cleanup

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

NONE

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Apr 23, 2021
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 23, 2021
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: savitaashture

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2021
@dibyom
Copy link
Member Author

dibyom commented Apr 27, 2021

/cc @jmcshane @wlynch

)
}

// IsAllowedType returns nil if the resourceTemplate has an apiVersion
Copy link
Member

Choose a reason for hiding this comment

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

IsAllowed implies a bool response?

Copy link
Member

Choose a reason for hiding this comment

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

And the calls to it are really boolean checks for it being nil or not

Copy link
Member

Choose a reason for hiding this comment

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

I would also be in favour of e.g. EnsureAllowedType or something similar. IsSomething always implies a bool response to me as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to EnsureAllowedType. Thanks!

This will help reduce the number of places we keep track of the list of
types that Triggers can create especially as we add the v1beta1 types.

Partially addresses tektoncd#494 and part of the work needed for tektoncd#1067
@MarcelMue
Copy link
Member

/LGTM

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2021
@tekton-robot tekton-robot merged commit a23ac4f into tektoncd:main May 4, 2021
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm 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.

5 participants