Skip to content

Commit 142af53

Browse files
Check UserManaged is not nil in azure/converters/diagnostics
1 parent d817ab3 commit 142af53

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

azure/converters/diagnostics.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ func GetDiagnosticsProfile(diagnostics *infrav1.Diagnostics) *armcompute.Diagnos
3939
},
4040
}
4141
case infrav1.UserManagedDiagnosticsStorage:
42-
return &armcompute.DiagnosticsProfile{
43-
BootDiagnostics: &armcompute.BootDiagnostics{
44-
Enabled: ptr.To(true),
45-
StorageURI: &diagnostics.Boot.UserManaged.StorageAccountURI,
46-
},
42+
if diagnostics.Boot.UserManaged != nil {
43+
return &armcompute.DiagnosticsProfile{
44+
BootDiagnostics: &armcompute.BootDiagnostics{
45+
Enabled: ptr.To(true),
46+
StorageURI: &diagnostics.Boot.UserManaged.StorageAccountURI,
47+
},
48+
}
4749
}
4850
}
4951
}

0 commit comments

Comments
 (0)