Skip to content

Registry cache implementation: add a property to the Runtime CR that enables the cache #886

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

Merged
merged 23 commits into from
May 19, 2025

Conversation

akgalwas
Copy link
Contributor

@akgalwas akgalwas commented May 8, 2025

Description

Changes proposed in this pull request:

  • spec.imageRegistryCache.enabled property added
  • if spec.imageRegistryCache.enabled is true registry config extension is configured based on the settings from CustomConfig CR

Related issue(s)

#635

@akgalwas akgalwas marked this pull request as ready for review May 14, 2025 11:30
@akgalwas akgalwas requested a review from a team as a code owner May 14, 2025 11:30
)

func getRegistryCache(ctx context.Context, s *systemState, m *fsm) ([]v1beta1.RegistryCache, error) {
getSecretFunc := func() (v1.Secret, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we either

  • modify getRegistryCache function signature and pass getSecretFunc function as argument or
  • limit arguments just to Client, Labels and Namespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just got rid of getSecretFunc as it is not needed for now (and probably won't be).

kubeconfigSecretKey = "config"
)

// TODO: Use this function in the Runtime Controller's FSM
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets investigate it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FSM states for OIDC, and RBAC use a function that is defined in the fsm package. In the next steps I will refactor this to use the function from the github.com/kyma-project/infrastructure-manager/pkg/gardener package.

m00g3n
m00g3n previously approved these changes May 19, 2025
Copy link
Contributor

@m00g3n m00g3n left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Merging this branch changes the coverage (2 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/kyma-project/infrastructure-manager/api/v1 0.00% (ø)
github.com/kyma-project/infrastructure-manager/cmd 0.00% (ø)
github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm 52.26% (-0.88%) 👎
github.com/kyma-project/infrastructure-manager/internal/registrycache 0.00% (ø)
github.com/kyma-project/infrastructure-manager/pkg/gardener 48.89% (-9.01%) 👎
github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot 92.86% (ø)
github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/extender/extensions 91.07% (+2.32%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/kyma-project/infrastructure-manager/api/v1/runtime_types.go 0.00% (ø) 35 0 35
github.com/kyma-project/infrastructure-manager/api/v1/zz_generated.deepcopy.go 0.00% (ø) 261 (+10) 0 261 (+10)
github.com/kyma-project/infrastructure-manager/cmd/main.go 0.00% (ø) 139 (+3) 0 139 (+3)
github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm/runtime_fsm_create_shoot.go 0.00% (ø) 46 0 46
github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm/runtime_fsm_patch_shoot.go 78.57% (-8.04%) 126 (+14) 99 (+2) 27 (+12) 👎
github.com/kyma-project/infrastructure-manager/internal/registrycache/explorer.go 0.00% (ø) 20 (+20) 0 20 (+20)
github.com/kyma-project/infrastructure-manager/pkg/gardener/client.go 0.00% (ø) 14 (+7) 0 14 (+7)
github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/converter.go 92.86% (ø) 28 26 2
github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/extender/extensions/extender.go 90.74% (+2.10%) 54 (+10) 49 (+10) 5 👍
github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/extender/extensions/registry_config.go 95.45% (+95.45%) 22 (+22) 21 (+21) 1 (+1) 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/extender/extensions/extensions_extender_test.go
  • github.com/kyma-project/infrastructure-manager/pkg/gardener/shoot/extender/extensions/registry_config_test.go

@m00g3n m00g3n merged commit bdf0d33 into kyma-project:main May 19, 2025
10 checks passed
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.

2 participants