Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Populate all imageRepository fields in TKR_DATA values #4298

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

imikushin
Copy link
Contributor

@imikushin imikushin commented Jan 26, 2023

What this PR does / why we need it

imageRepository fields in TKR.spec.kubernetes.{etcd,pause,coredns,kube-vip} can be empty. In this case, the clients should be defaulting to TKR.spec.kubernetes.imageRepository.

This change allows to simplify ClusterClass JSON patches doing this: they can now assume imageRepository fields in TKR_DATA values are non-empty and have the correct value.

Which issue(s) this PR fixes

Fixes #4315

Describe testing done for PR

Updated unit tests to reflect the described situation.

Release note

Allow for simpler ClusterClass JSON patches accessing 
kubernetesSpec.{etcd,pause,coredns,kube-vip}.imageRepository fields in TKR_DATA values. 
They can now assume imageRepository fields in TKR_DATA values are non-empty and default to 
kubernetesSpec.imageRepository (if they are empty in the TKR).

Additional information

Special notes for your reviewer

`imageRepository` fields in `TKR.spec.kubernetes.{etcd,pause,coredns,
kube-vip}` can be empty. In this case, the clients should be defaulting
to `TKR.spec.kubernetes.imageRepository`.

This change allows to simplify ClusterClass JSON patches doing this:
they can now assume imageRepository fields in TKR_DATA values are
non-empty and have the correct value.

Signed-off-by: Ivan Mikushin <imikushin@vmware.com>
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #4298 (257317c) into main (22174df) will decrease coverage by 0.88%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #4298      +/-   ##
==========================================
- Coverage   49.42%   48.55%   -0.88%     
==========================================
  Files         452      482      +30     
  Lines       44789    46934    +2145     
==========================================
+ Hits        22139    22788     +649     
- Misses      20563    22007    +1444     
- Partials     2087     2139      +52     
Impacted Files Coverage Δ
addons/controllers/clusterbootstrap_controller.go 64.84% <0.00%> (-1.56%) ⬇️
...ons/controllers/packageinstallstatus_controller.go 79.15% <0.00%> (ø)
cmd/cli/plugin/cluster/delete_node_pool.go 16.66% <0.00%> (ø)
cmd/cli/plugin/isolated-cluster/test/main.go 0.00% <0.00%> (ø)
cmd/cli/plugin/cluster/set_node_pool.go 14.63% <0.00%> (ø)
cmd/cli/plugin/cluster/available_upgrade.go 16.32% <0.00%> (ø)
cmd/cli/plugin/cluster/list.go 11.36% <0.00%> (ø)
cmd/cli/plugin/cluster/credentials_update.go 8.73% <0.00%> (ø)
cmd/cli/plugin/cluster/upgrade.go 58.94% <0.00%> (ø)
cmd/cli/plugin/cluster/create.go 42.22% <0.00%> (ø)
... and 28 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@hongtaiwang hongtaiwang left a comment

Choose a reason for hiding this comment

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

lgtm

@imikushin imikushin added the ok-to-merge PRs should be labelled with this before merging label Feb 2, 2023
@imikushin imikushin merged commit 6cdbd30 into main Feb 2, 2023
@imikushin imikushin deleted the topic/imikushin/default-image-repository branch February 2, 2023 22:06
imikushin added a commit that referenced this pull request Feb 15, 2023
`imageRepository` fields in `TKR.spec.kubernetes.{etcd,pause,coredns,
kube-vip}` can be empty. In this case, the clients should be defaulting
to `TKR.spec.kubernetes.imageRepository`.

This change allows to simplify ClusterClass JSON patches doing this:
they can now assume imageRepository fields in TKR_DATA values are
non-empty and have the correct value.

Signed-off-by: Ivan Mikushin <imikushin@vmware.com>
(cherry picked from commit 6cdbd30)
imikushin added a commit that referenced this pull request Feb 17, 2023
`imageRepository` fields in `TKR.spec.kubernetes.{etcd,pause,coredns,
kube-vip}` can be empty. In this case, the clients should be defaulting
to `TKR.spec.kubernetes.imageRepository`.

This change allows to simplify ClusterClass JSON patches doing this:
they can now assume imageRepository fields in TKR_DATA values are
non-empty and have the correct value.

Signed-off-by: Ivan Mikushin <imikushin@vmware.com>
(cherry picked from commit 6cdbd30)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tkr cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always populate kubernetesSpec.{*}.imageRepository fields in TKR_DATA values
4 participants