File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,13 @@ func GetDiagnosticsProfile(diagnostics *infrav1.Diagnostics) *armcompute.Diagnos
39
39
},
40
40
}
41
41
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
+ }
47
49
}
48
50
}
49
51
}
Original file line number Diff line number Diff line change @@ -81,6 +81,16 @@ func TestGetDiagnosticsProfile(t *testing.T) {
81
81
},
82
82
want : nil ,
83
83
},
84
+ {
85
+ name : "nil diagnostics boot user managed" ,
86
+ diagnostics : & infrav1.Diagnostics {
87
+ Boot : & infrav1.BootDiagnostics {
88
+ StorageAccountType : infrav1 .UserManagedDiagnosticsStorage ,
89
+ UserManaged : nil ,
90
+ },
91
+ },
92
+ want : nil ,
93
+ },
84
94
}
85
95
for _ , tt := range tests {
86
96
tt := tt
You can’t perform that action at this time.
0 commit comments