Skip to content

Commit

Permalink
Merge pull request #12061 from rak-phillip/bugfix/11987-missing-machi…
Browse files Browse the repository at this point in the history
…ne-selector

Default to empty object for missing `machineSelectorConfig`
  • Loading branch information
rak-phillip authored Oct 1, 2024
2 parents f5759e4 + d4c84f4 commit cb6c4d1
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 cb6c4d1

Please sign in to comment.