Fix incorrect default OS image selection when Ubuntu is disabled#7927
Fix incorrect default OS image selection when Ubuntu is disabled#7927KhizerRehan wants to merge 2 commits intokubermatic:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
a9144a8 to
b32d378
Compare
| } | ||
| this.initiallySelectedOS = null; | ||
|
|
||
| switch (os) { |
There was a problem hiding this comment.
Refactored in favour of single method since we are getting default template from DatacenterOperatingSystemOptions which shares same type as of Images as above provider options.
let me know if any concerns.
|
/test pre-dashboard-web-integration-tests-ce |
|
|
||
| if (this.wizardMode && this.wizardMode !== WizardMode.CreateClusterTemplate) { | ||
| const currentOS = this._nodeDataService.operatingSystem; | ||
| if (currentOS && this.isOperatingSystemSupported(currentOS) && this.allowedOperatingSystems[currentOS]) { |
There was a problem hiding this comment.
check the method isOperatingSystemAllowed we do show the current os system even if it's not allowed
this.currentNodeOS === os
if we want the OS to be shown in the edits/customize cluster template modes then shouldn't we keep it as selected by default?
There was a problem hiding this comment.
I need to clarify an edge case
- User selects e.g Ubuntu as OS while creating a template
- Admin or At Project level that OS is disabled
- User tries to edit -> same template which has Ubuntu selected
What should be the behaviour in case it is disabled
- At Admin or Project level
Shouldn't we explicilty remove OS even from edit/customize of template becasue OS was not allowed from (Project or Admin Settings)
any thoughts on this?
cc: @ahmadhamzh: I have simplified logic let me know wdyt?
There was a problem hiding this comment.
I think it should be the same behavior as before, so the selected option should be shown because I think that is not related to the bug ticket.
| @@ -0,0 +1,35 @@ | |||
| // Copyright 2026 The Kubermatic Kubernetes Platform contributors. | |||
There was a problem hiding this comment.
im not sure about this file name what it should contain why you consider the getDefaultForOS is something regarding provider, shouldn't we name the file e.g node-data , or maybe we can add the function in this file src/app/shared/utils/node.ts WDYT ?
KhizerRehan
left a comment
There was a problem hiding this comment.
Feedback Response(PTAL)
| @@ -0,0 +1,35 @@ | |||
| // Copyright 2026 The Kubermatic Kubernetes Platform contributors. | |||
|
|
||
| if (this.wizardMode && this.wizardMode !== WizardMode.CreateClusterTemplate) { | ||
| const currentOS = this._nodeDataService.operatingSystem; | ||
| if (currentOS && this.isOperatingSystemSupported(currentOS) && this.allowedOperatingSystems[currentOS]) { |
There was a problem hiding this comment.
I need to clarify an edge case
- User selects e.g Ubuntu as OS while creating a template
- Admin or At Project level that OS is disabled
- User tries to edit -> same template which has Ubuntu selected
What should be the behaviour in case it is disabled
- At Admin or Project level
Shouldn't we explicilty remove OS even from edit/customize of template becasue OS was not allowed from (Project or Admin Settings)
any thoughts on this?
cc: @ahmadhamzh: I have simplified logic let me know wdyt?
d950bd2 to
d214ec8
Compare
|
/test pre-dashboard-web-integration-tests-ce |
What this PR does / why we need it:
This PR fixes incorrect OS defaulting behavior where Nutanix and OpenStack node data components always reset the operating system to Ubuntu and checking/selecting first next allowed operating system
Pre-requisits:
ubuntuOS from Admin Panel (Globally)Try to create a cluster with Ubuntu
disabledBefore:
After
Which issue(s) this PR fixes:
Fixes #7242
Testing
Expected: First allowed OS is auto-selected; the image field shows the correct image for that OS (not Ubuntu) and shows correct OSP selected based on OS.
What type of PR is this?
/kind bug
Special notes for your reviewer:
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: