Skip to content

Commit

Permalink
Default to empty object for missing machineSelectorConfig
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
  • Loading branch information
rak-phillip committed Sep 27, 2024
1 parent c3566e0 commit d4c84f4
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 d4c84f4

Please sign in to comment.