Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cfn-resources/cluster/cmd/resource/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func expandLabelSlice(labels []Labels) *[]admin.ComponentLabel {
key = *labels[i].Key
}
var value string
if labels[i].Key != nil {
if labels[i].Value != nil {
value = *labels[i].Value
}
res[i] = admin.ComponentLabel{
Expand Down Expand Up @@ -601,7 +601,9 @@ func setClusterRequest(currentModel *Model) (*admin.AdvancedClusterDescription,

clusterRequest.TerminationProtectionEnabled = currentModel.TerminationProtectionEnabled

clusterRequest.AdvancedConfiguration = expandClusterAdvancedConfiguration(*currentModel.AdvancedSettings)
if currentModel.AdvancedSettings != nil {
Copy link

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the nil check for currentModel.AdvancedSettings prevents a potential nil pointer deference during cluster creation. This approach improves the robustness of the cluster setup.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a contract test which does not define AdvancedSettings?

Copy link
Member Author

@lantoli lantoli Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ticket created: CLOUDP-321624

clusterRequest.AdvancedConfiguration = expandClusterAdvancedConfiguration(*currentModel.AdvancedSettings)
}
return clusterRequest, nil
}

Expand Down
Loading