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

🌱 refactoring hash function to global template funcs #1812

Conversation

christopherhein
Copy link
Member

This change was sparked from the conversation on #722 see https://github.com/kubernetes-sigs/kubebuilder/pull/1790/files#r518340728 for the suggestion.

This moves a reused func to the global funcmap to reduced the need to copy it a third time for

Signed-off-by: Chris Hein me@chrishein.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 11, 2020
@christopherhein
Copy link
Member Author

/assign @Adirio

@christopherhein
Copy link
Member Author

/assign @camilamacedo86

Copy link
Contributor

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Just one nit

pkg/model/file/funcmap.go Outdated Show resolved Hide resolved
pkg/model/file/funcmap.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Adirio Adirio left a comment

Choose a reason for hiding this comment

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

/lgtm

In case you apply @estroz suggestion, remember to modify these two entries too:

pkg/plugin/v2/scaffolds/internal/templates/main.go Outdated Show resolved Hide resolved
pkg/plugin/v3/scaffolds/internal/templates/main.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2020
Signed-off-by: Chris Hein <me@chrishein.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2020
@christopherhein
Copy link
Member Author

Thanks @Adirio and @estroz for the review on this. I've updated it to hashFNV.

@Adirio
Copy link
Contributor

Adirio commented Nov 12, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 12, 2020
@estroz
Copy link
Contributor

estroz commented Nov 12, 2020

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Adirio, christopherhein, estroz

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 Nov 12, 2020
@christopherhein
Copy link
Member Author

Thanks @estroz

@k8s-ci-robot k8s-ci-robot merged commit 097d34e into kubernetes-sigs:master Nov 12, 2020
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. 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.

None yet

5 participants