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

Drop internal version of gardenlet.config.gardener.cloud API #11101

Merged
merged 10 commits into from
Jan 24, 2025

Conversation

timebertt
Copy link
Member

How to categorize this PR?

/area dev-productivity
/kind cleanup

What this PR does / why we need it:

This PR drops the internal version of the gardenlet.config.gardener.cloud API.

Which issue(s) this PR fixes:
Part of #11043

Special notes for your reviewer:

This PR is probably the trickiest one to review of the overall refactoring story.
This is due to the cross-references of types and validation between 3 API groups:

seedmanagement API --(includes gardenlet config)--> gardenlet config API --(includes seed template)--> core API

Because of this, I needed to move some conversion logic of these APIs around, which makes the PR more complex to review.

The individual commits might not be entirely correct on their own (might not compile), as it was difficult to separate individual steps.
I separated the changes into individual commits by focusing on what should be reviewed with more focus than other parts (e.g., changing conversion logic vs bulk edits of imports).

Release note:

NONE

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) kind/cleanup Something that is not needed anymore and can be cleaned up cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Jan 2, 2025
@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 2, 2025
@timebertt timebertt force-pushed the config-apis-gardenlet branch from 57c03c2 to 85a7fd6 Compare January 3, 2025 07:40
@timebertt
Copy link
Member Author

/retest

@gardener-prow gardener-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 7, 2025
@timebertt timebertt force-pushed the config-apis-gardenlet branch from 85a7fd6 to 52d5c8c Compare January 17, 2025 12:13
@gardener-prow gardener-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2025
@timebertt
Copy link
Member Author

Rebased the PR to resolve conflicts.

Copy link
Contributor

@ary1992 ary1992 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

pkg/apis/core/helper/helpers.go Outdated Show resolved Hide resolved
pkg/apis/core/helper/helpers.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Kostov6 Kostov6 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you keep in mind #11232 when changing the helper functions?

The gardenlet config validation calls the validation for the `SeedTemplate` on the core API's internal version.
Hence, we add a helper that allows us convert the external `SeedTemplate` in the external gardenlet config API
to the internal core representation where the validation is implemented.
Some code previously converted an external gardenlet config to the internal representation (e.g., `ManagedSeed{,Set}` validation,
`ManagedSeed` admission, gardenlet deployer). These occurrences are adapted now to handle the external gardenlet config directly
and convert only the included `SeedTemplate` to the internal version if needed (e.g., for validation, defaulting).
The operator config API reuses the `ETCDConfig` type from the gardenlet config API.
gardener-operator passes these config values when instantiating the etcd and etcd-druid components.

This commit switches the internal operator config API version to also use the external version of the
gardenlet `ETCDConfig` type. With this, we spare the temporary conversion in gardener-operator until
we drop the internal version of the operator config API.
The overall goal is to tackle both components in dedicated PRs to keep them reviewable.
@timebertt timebertt force-pushed the config-apis-gardenlet branch from 52d5c8c to cb2cebe Compare January 24, 2025 08:12
@timebertt
Copy link
Member Author

Thanks for the review @ary1992. I addressed your suggestions in a new commit.

@timebertt
Copy link
Member Author

Can you keep in mind #11232 when changing the helper functions?

I suggest moving forward with this PR first and performing the necessary changes to the helper files in #11232.
It's hard enough to perform this change here without running into conflicts with other PRs. Performing the refactoring related to the other PR in this one would distract the PR reviews here.

Copy link
Contributor

@ary1992 ary1992 left a comment

Choose a reason for hiding this comment

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

Thanks!
/lgtm
/approve

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2025
Copy link
Contributor

gardener-prow bot commented Jan 24, 2025

LGTM label has been added.

Git tree hash: 12fc3ad4eccf74572573bb293941c78fe9a8de7e

Copy link
Contributor

gardener-prow bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ary1992

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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 24, 2025
Copy link
Contributor

gardener-prow bot commented Jan 24, 2025

@timebertt: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gardener-apidiff cb2cebe link false /test pull-gardener-apidiff

Full PR test history. Your PR dashboard. Command help for this repository.
Please help us cut down on flakes by linking this test failure to an open flake report or filing a new flake report if you can't find an existing one. Also see our testing guideline for how to avoid and hunt flakes.

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. I understand the commands that are listed here.

@timebertt
Copy link
Member Author

/retest-required

@gardener-prow gardener-prow bot merged commit d82db86 into gardener:master Jan 24, 2025
18 of 19 checks passed
@timebertt timebertt deleted the config-apis-gardenlet branch January 24, 2025 13:49
Roncossek pushed a commit to Roncossek/gardener that referenced this pull request Jan 27, 2025
…ner#11101)

* Prefactor: remove indirection of token requestor controllers

* Move API validation

The gardenlet config validation calls the validation for the `SeedTemplate` on the core API's internal version.
Hence, we add a helper that allows us convert the external `SeedTemplate` in the external gardenlet config API
to the internal core representation where the validation is implemented.

* Move API helper

* Drop internal API version

* Adapt conversion

Some code previously converted an external gardenlet config to the internal representation (e.g., `ManagedSeed{,Set}` validation,
`ManagedSeed` admission, gardenlet deployer). These occurrences are adapted now to handle the external gardenlet config directly
and convert only the included `SeedTemplate` to the internal version if needed (e.g., for validation, defaulting).

* Adapt entrypoint

* Adapt imports

* Adapt operator config API

The operator config API reuses the `ETCDConfig` type from the gardenlet config API.
gardener-operator passes these config values when instantiating the etcd and etcd-druid components.

This commit switches the internal operator config API version to also use the external version of the
gardenlet `ETCDConfig` type. With this, we spare the temporary conversion in gardener-operator until
we drop the internal version of the operator config API.
The overall goal is to tackle both components in dedicated PRs to keep them reviewable.

* Update skaffold dependencies

* Address review suggestions
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/dev-productivity Developer productivity related (how to improve development) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/cleanup Something that is not needed anymore and can be cleaned up lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants