Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions azure/converters/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ func GetDiagnosticsProfile(diagnostics *infrav1.Diagnostics) *armcompute.Diagnos
},
}
case infrav1.UserManagedDiagnosticsStorage:
return &armcompute.DiagnosticsProfile{
BootDiagnostics: &armcompute.BootDiagnostics{
Enabled: ptr.To(true),
StorageURI: &diagnostics.Boot.UserManaged.StorageAccountURI,
},
if diagnostics.Boot.UserManaged != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a new UT case "nil diagnostics.Boot.UserManaged" to the TestGetDiagnosticsProfile spec under azure/converters/diagnostics_test.go?

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you!

return &armcompute.DiagnosticsProfile{
BootDiagnostics: &armcompute.BootDiagnostics{
Enabled: ptr.To(true),
StorageURI: &diagnostics.Boot.UserManaged.StorageAccountURI,
},
}
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions azure/converters/diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ func TestGetDiagnosticsProfile(t *testing.T) {
},
want: nil,
},
{
name: "nil diagnostics boot user managed",
diagnostics: &infrav1.Diagnostics{
Boot: &infrav1.BootDiagnostics{
StorageAccountType: infrav1.UserManagedDiagnosticsStorage,
UserManaged: nil,
},
},
want: nil,
},
}
for _, tt := range tests {
tt := tt
Expand Down