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

make applyconfiguration-gen work in non-kube repositiories #111934

Merged
merged 7 commits into from Aug 27, 2022

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 19, 2022

When using this generator from another repo, its necessary to add OwnerReference to avoid generation like

func (b *APIRequestCountApplyConfiguration) WithOwnerReferences(values ...metav1.OwnerReference) *APIRequestCountApplyConfiguration {

that won't compile

This fixes several problems

  1. add metav1.OwnerReference to the default external configurations to ease generation
  2. add handling for types that have non-embedded TypeMeta
  3. fix flag handling for --external-applyconfigurations so it can be used.
  4. make it work with resources without objectmeta so the generated code compiles
  5. make it handle pointers to slices

/kind bug
/priority important-soon
/sig api-machinery
/assign @jpbetz

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Aug 19, 2022
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.25 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.25.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Fri Aug 19 13:42:37 UTC 2022.

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 19, 2022
@deads2k deads2k changed the title add metav1.OwnerReference to the default external configurations to ease generation make applyconfiguration-gen work in non-kube repositiories Aug 19, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 19, 2022
deads2k added a commit to deads2k/code-generator that referenced this pull request Aug 22, 2022
deads2k added a commit to deads2k/code-generator that referenced this pull request Aug 22, 2022
deads2k added a commit to deads2k/code-generator that referenced this pull request Aug 22, 2022
deads2k added a commit to deads2k/code-generator that referenced this pull request Aug 22, 2022
deads2k added a commit to openshift/kubernetes-code-generator that referenced this pull request Aug 22, 2022
@leilajal
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 23, 2022
@jpbetz
Copy link
Contributor

jpbetz commented Aug 23, 2022

/lgtm

Thanks for fixing!

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Aug 23, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 2022
@liggitt
Copy link
Member

liggitt commented Aug 26, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, liggitt

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 Aug 26, 2022
@jpbetz
Copy link
Contributor

jpbetz commented Aug 27, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5f57708 into kubernetes:master Aug 27, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Aug 27, 2022
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/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants