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-server): add defaulter in MeshService and MeshMultizoneService #12846

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lahabana
Copy link
Contributor

Motivation

There are fields like targetPort on port name that default to another value if not set.
This can't be expressed with annotations so defaulting with a Defaulter is usefull in these cases.

Implementation information

There's an open question around what this would do with things like TF as the PUT and GET return something different.

There are fields like targetPort on port name that default to another
value if not set.
This can't be expressed with annotations so defaulting with a
`Defaulter` is usefull in these cases.

There's an open question around what this would do with things like TF
as the PUT and GET return something different.

Signed-off-by: Charly Molter <[email protected]>
Copy link
Contributor

Reviewer Checklist

🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
If something doesn't apply please check the box and add a justification if the reason is non obvious.

  • Is the PR title satisfactory? Is this part of a larger feature and should be grouped using > Changelog?
  • PR description is clear and complete. It Links to relevant issue as well as docs and UI issues
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as an image registry)
  • IPv6 is taken into account (.e.g: no string concatenation of host port)
  • Tests (Unit test, E2E tests, manual test on universal and k8s)
    • Don't forget ci/ labels to run additional/fewer tests
  • Does this contain a change that needs to be notified to users? In this case, UPGRADE.md should be updated.
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label)

@lahabana lahabana requested a review from schogges February 13, 2025 13:19
@lahabana
Copy link
Contributor Author

If we go forward with this change we need to make sure the API docs are updated to explain this defaulting

Copy link
Contributor

@schogges schogges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far 👍 left a Q on the golden files

Copy link
Contributor

@schogges schogges Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why some of the golden files include only empty objects? 🙂
From my understanding that's the expected response?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default response for a PUT returns an empty object, that's what this first reponse is.

@slonka
Copy link
Contributor

slonka commented Feb 17, 2025

Disclaimer: I only checked the description of that it supposed to do (not the code).

There is no other way if this can't be described by simply an annotation. In terraform this can be marked as "computed" and won't show up in the diff. So based on that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants