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

fix(api): make LocalObjectReference.Name and HostAlias.IP required #124553

Merged

Conversation

pmalek
Copy link
Contributor

@pmalek pmalek commented Apr 26, 2024

What type of PR is this?

/kind bug
/kind api-change

What this PR does / why we need it:

Fixes CRD generation for types that contain LocalObjectReference

The CustomResourceDefinition "dataplanes.gateway-operator.konghq.com" is invalid: spec.validation.openAPIV3Schema.properties[spec].properties[deployment].properties[imagePullSecretsPodSpec].items.properties[name].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property

Also while at it this makes HostAlias.IP required

Which issue(s) this PR fixes:

Fixes #124540

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixes a 1.30.0 regression in openapi descriptions of imagePullSecrets and hostAliases fields to mark the fields used as keys in those lists as either defaulted or required.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 26, 2024
@thockin
Copy link
Member

thockin commented Apr 26, 2024

I am sure there are more - I added a bunch of these key declarations. Let's see what CI says

@thockin
Copy link
Member

thockin commented Apr 26, 2024

/retest

@thockin
Copy link
Member

thockin commented Apr 26, 2024

We may also want to do HostAlias.IP

@thockin
Copy link
Member

thockin commented Apr 26, 2024

You'll have to run hack/update-codegen.sh

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/code-generation sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 26, 2024
@pmalek
Copy link
Contributor Author

pmalek commented Apr 26, 2024

You'll have to run hack/update-codegen.sh

Done.

/retest

@thockin
Copy link
Member

thockin commented Apr 26, 2024

Sorry, you also have to run hack/update-openapi-spec.sh (or just run make update, but that's slow)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 27, 2024
@pmalek
Copy link
Contributor Author

pmalek commented Apr 27, 2024

Done.

/retest

@pmalek
Copy link
Contributor Author

pmalek commented Apr 27, 2024

@thockin Looks like all jobs passed now.

@pmalek pmalek marked this pull request as ready for review April 27, 2024 18:28
@pmalek pmalek force-pushed the make-localobjectref-name-required branch from 38d5336 to e523b70 Compare May 3, 2024 19:04
@thockin
Copy link
Member

thockin commented May 3, 2024

Code LGTM. Need to run hack/update-codegen.sh

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 743a3005f61379372a5ed15a377dbe6bf982aa0c

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2024
@k8s-ci-robot k8s-ci-robot requested a review from thockin May 3, 2024 21:09
@pmalek
Copy link
Contributor Author

pmalek commented May 3, 2024

Code LGTM. Need to run hack/update-codegen.sh

I was pretty sure I ran it this time 😬 5777fd4

@thockin thockin added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 3, 2024
@thockin
Copy link
Member

thockin commented May 3, 2024

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 62c576fc704bd166ca56056829fcd46e0723976a

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmalek, thockin

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 merged commit 8dbeaa5 into kubernetes:master May 3, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone May 3, 2024
@thockin
Copy link
Member

thockin commented May 3, 2024

Will you be sending the backport PR, too?

pmalek added a commit to pmalek/kubernetes that referenced this pull request May 4, 2024
…ubernetes#124553)

* fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required

* chore(api): add LocalObjectReference comment

* chore(api): add omitempty to LocalObjectReference's Name

* chore(api): add kubebuilder:default annotation

* chore(api): ./hack/update-codegen.sh
@pmalek
Copy link
Contributor Author

pmalek commented May 4, 2024

Will you be sending the backport PR, too?

@thockin I've pushed #124694. Let me know if that works.

jingczhang pushed a commit to nokia/kubernetes that referenced this pull request May 7, 2024
…ubernetes#124553)

* fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required

* chore(api): add LocalObjectReference comment

* chore(api): add omitempty to LocalObjectReference's Name

* chore(api): add kubebuilder:default annotation

* chore(api): ./hack/update-codegen.sh
k8s-ci-robot added a commit that referenced this pull request May 10, 2024
[backport release-1.30]: fix(api): make LocalObjectReference.Name and HostAlias.IP required (#124553)
@fedebongio
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 May 14, 2024
@tatsuhiro-t
Copy link
Contributor

PodIP.IP should also be marked required.
Because it is +listMapKey=ip in PodStatus.PodIPs.

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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. 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.

1.30 adds tags that break imagePullSecrets
9 participants