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

code-generator: complete PkgName, GroupName, GoName seperation #55614

Merged
merged 5 commits into from
Nov 15, 2017

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Nov 13, 2017

... in client-gen, informer-gen, lister-gen. Follow-up of #54950.

Before this PR, the generated code was broken for internal types and for group package names that were no valid Go identifiers.

This PR completes the separation in the following sense:

  • GroupNames are domain-like logical name for the group. Only the first segment is used as default for GoName
  • PkgName is the directory name. All packages in client, informer, lister re-use this for packages.
  • GoName is the Go identifier (CamelCase) used to reference the group, e.g. in the interface names, in the clientsets etc. Moreover it is used for package import aliases.

Note: this PR does not change the generated code in Kubernetes, only the examples in k8s.io/code-generator.

Fix code-generators to produce correct code when GroupName, PackageName and/or GoName differ.

- GroupNames are domain-like logical name for the group. Only the
  first segment is used as default for GoName
- PkgName is the directory name. All packages in client, informer, lister
  re-use this for packages.
- GoName is the Go identifier (CamelCase) used to reference the group, e.g.
  in the interface names, in the clientsets etc. Moreover it is used
  for package import aliases.

  The GoName defaults to the first segment of the GroupName.
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 13, 2017
@sttts sttts assigned mfojtik and caesarxuchao and unassigned lavalamp and wojtek-t Nov 13, 2017
@sttts sttts added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 13, 2017
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 14, 2017
@sttts sttts added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 14, 2017
@mfojtik
Copy link
Contributor

mfojtik commented Nov 14, 2017

Generated code looks good.

/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 14, 2017
@sttts
Copy link
Contributor Author

sttts commented Nov 14, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfojtik, sttts

Associated issue requirement bypassed by: sttts

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 54436, 53148, 55153, 55614, 55484). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 6328a99 into kubernetes:master Nov 15, 2017
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/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants