Closed Nimbus318 closed 3 days ago
All modified and coverable lines are covered by tests :white_check_mark:
Flag | Coverage Δ | |
---|---|---|
unittests | 26.80% <ø> (-0.07%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Very good bug fix, have we done some testing? For example, can it work properly in the K3s environment?
also,you should rebase your commits into one commit
I have rebased the commits into one as requested.
Regarding testing, I have not tested this in a real K3s environment. However, I conducted mock testing for this function locally by injecting a mock Kubernetes version value in _helpers.tpl for validation. Below are the steps I followed:
Mock the Kubernetes version by temporarily injecting a value for testing:
{{/*
Mock Kubernetes version for testing
*/}}
{{- define "mockedCapabilitiesKubeVersion" -}}
v1.31.1+k3s1
{{- end }}
Modify the existing logic to replace Capabilities.KubeVersion.Version with the mock value:
{{- define "strippedKubeVersion" -}}
{{- $parts := split "+" (include "mockedCapabilitiesKubeVersion" .) -}}
{{- print $parts._0 -}}
{{- end }}
Validated that the output correctly strips the metadata after +.
What type of PR is this? /kind bug
What this PR does / why we need it: This PR fixes an issue where Kubernetes version strings with additional metadata (e.g.,
+k3s1
) caused problems in dynamically generated image tags. The newstrippedKubeVersion
function removes the part after the+
in the Kubernetes version string, ensuring consistent and predictable image tagging.Which issue(s) this PR fixes: Fixes #621
Special notes for your reviewer: @archlitchi @wawa0210
Does this PR introduce a user-facing change?: Yes, this PR restores compatibility for specifying certain parameters during
helm install/upgrade
.After version 2.4.1, users were unable to specify parameters like
scheduler.kubeScheduler.tag
(scheduler image version),devicePlugin.deviceSplitCount
,devicePlugin.deviceMemoryScaling
, anddevicePlugin.deviceCoreScaling
directly during Helm operations.With this PR merged:
scheduler.kubeScheduler.tag
duringhelm install
orhelm upgrade
. If the parameter is not provided, the image version will continue to be auto-generated based on the Kubernetes version.deviceSplitCount
,deviceMemoryScaling
, anddeviceCoreScaling
are also restored for direct specification during Helm operations.