Skip to content

Commit

Permalink
Merge pull request #12113 from rancher/gha-portpr-11164175584-1
Browse files Browse the repository at this point in the history
[backport v2.9.3] Default to empty object for missing `machineSelectorConfig`
  • Loading branch information
rak-phillip authored Oct 3, 2024
2 parents 7b37bd0 + b630de0 commit 0f8cb76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shell/models/provisioning.cattle.io.cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ export default class ProvCluster extends SteveModel {
get agentConfig() {
// The one we want is the first one with no selector.
// If there are multiple with no selector, that will fall under the unsupported message below.
return this.spec.rkeConfig.machineSelectorConfig.find((x) => !x.machineLabelSelector)?.config;
return this.spec.rkeConfig?.machineSelectorConfig
.find((x) => !x.machineLabelSelector)?.config || { };
}

get cloudProvider() {
Expand Down

0 comments on commit 0f8cb76

Please sign in to comment.