Skip to content

Commit

Permalink
preselect cluster issuer on TLS enabled (#723)
Browse files Browse the repository at this point in the history
Signed-off-by: SayedTahsin <[email protected]>
  • Loading branch information
SayedTahsin authored Feb 6, 2025
1 parent 44e01d4 commit 9ffaaf0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,7 @@ steps:
text: labels.tls.default
schema:
$ref: schema#/properties/spec/properties/admin/properties/tls/properties/default
onChange: preSelectClusterIssuer
type: switch
hideForm: true
label:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,28 @@ function setStorageClass({ getValue, model, watchDependency, commit }) {
})
}

function preSelectClusterIssuer({ getValue, model, watchDependency, commit, discriminator }) {
const val = getValue(model, '/spec/admin/tls/default')
const clusterIssuers = getClusterIssuers({ watchDependency, getValue, discriminator })
if (val) {
if (clusterIssuers.length) {
commit('wizard/model$update', {
path: '/spec/admin/clusterIssuers/available',
value: [clusterIssuers[0]],
force: true,
})
}
} else {
commit('wizard/model$update', {
path: '/spec/admin/clusterIssuers/available',
value: '',
force: true,
})
}
}

return {
preSelectClusterIssuer,
isRancherManaged,
getOptions,
getNodeTopology,
Expand Down

0 comments on commit 9ffaaf0

Please sign in to comment.