kubernetes / kubernetes

Production-Grade Container Scheduling and Management
https://kubernetes.io
Apache License 2.0
110.72k stars 39.57k forks source link

Webhook converter fails if object being converted is missing metadata #117357

Open ncdc opened 1 year ago

ncdc commented 1 year ago

What happened?

Because of #117356, the webhook converter may receive an object to convert that has no metadata. In that scenario, it returns an error, because it expects the input object to have metadata.

What did you expect to happen?

No error

How can we reproduce it (as minimally and precisely as possible)?

https://github.com/LittleWat/conversion-webhook-test-with-flux

Anything else we need to know?

Ideally the converter should always receive an object with metadata. Until then, it should match its output expectations to the input object; i.e., if the input does not have metadata, it should not require that the output does have it.

Kubernetes version

```console $ kubectl version # paste output here ```

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

k8s-triage-robot commented 1 year ago

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

jiahuif commented 1 year ago

/assign @Jefftree /triage accepted

k8s-triage-robot commented 9 months ago

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

jiahuif commented 9 months ago

/triage accepted

k8s-triage-robot commented 3 months ago

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

BenTheElder commented 3 months ago

@liggitt should we keep this accepted or close it?

cici37 commented 3 months ago

/assign @jpbetz Thanks :) /triage accepted

k8s-triage-robot commented 2 weeks ago

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

Jefftree commented 2 weeks ago

/assign @seans3 /triage accepted