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

Promote minimized CRD ObjectMeta type to be it's own named type #805

Open
jessefeinman opened this issue Apr 27, 2023 · 9 comments
Open
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@jessefeinman
Copy link

When building tooling that looks at CRDs or works with k8s yaml, understanding the types that are are being used is helpful for custom validations, rewrites, generation, and other rules.

In CRDs when someone references ObjectMeta, rather than getting all of ObjectMeta the CRD has a minimal representation, this was done in #557 (comment) which causes issues for our tooling when, specifically, PodTemplateSpec which contains ObjectMeta in it is used in some CRDs, this results in only parts of ObjectMeta being present in the resulting schema.

While we have a work around to look for the minimized structure of ObjectMeta that is written in CRDs, it's essentially a fuzzy match dependent on however the code-generator behaves, which isn't a reliable way to make tooling.

Rather than writing a minimized version of ObjectMeta, instead I propose adding a new type to the k8s schema that represents an embedded ObjectMeta that has a stronger guarantee of stability. For example MinimalObjectMeta or something which would be what is currently written in CRDs. This would allow for some level of stability for what we can expect in a schema where that occurs instead of needing to guess what fields the code-generator us using today if we want to apply custom tooling to ObjectMeta types.

This came up in part because the fields that are added are a mix of the fields from various sections in the docs about ObjectMeta https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/ where initial thinking may be the non-service and writable fields would be available in CRDs but instead the mix leads to confusion which a named type would solve.

Related
https://github.com/kubernetes-sigs/controller-tools/pull/557/files#diff-d44a1fc23240ca1bdc8c22b4e23fe14ce4366bb1624542b417de0008d68a8e9aL115
kubernetes/kubernetes#103739

@jessefeinman jessefeinman changed the title Promote minimized ObjectMeta type to be it's own named type Promote minimized CRD ObjectMeta type to be it's own named type Apr 27, 2023
@adusumillipraveen
Copy link

Is there a plan to change this ?

We have a similar issue while using Gitops. Flux controllers use ObjectMeta for the CRDs. As the tool doesn't generate full schema for metadata, few formatting issues escape our CI checks and cause issues. More details in fluxcd/flux2#4038

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 25, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 24, 2024
@danielwilsonkainos
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Feb 27, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 27, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 26, 2024
@timja
Copy link

timja commented Jun 26, 2024

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 26, 2024
@sbueringer
Copy link
Member

sbueringer commented Jul 10, 2024

Wondering if v1 ObjectMeta is stable, so we should be able to just add all fields

/reopen
/remove-lifecycle rotten
/lifecycle frozen
/help

@k8s-ci-robot
Copy link
Contributor

@sbueringer:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

Wondering if v1 ObjectMeta is stable, so we should be able to just add all fields

/reopen
/remove-lifecycle rotten
/lifecycle frozen
/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

7 participants