Skip to content

Commit 5d89809

Browse files
committed
fix nil panic
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent ddcb51f commit 5d89809

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

loganalytics/prober.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ func (p *LogAnalyticsProber) Init() {
129129
),
130130
)
131131
}
132+
}
133+
134+
func (p *LogAnalyticsProber) SetAzureClient(client *armclient.ArmClient) {
135+
p.Azure.Client = client
132136

133137
tagManagerConfig, err := p.Azure.Client.TagManager.ParseTagConfig(p.Conf.Azure.ResourceTags)
134138
if err != nil {

probe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewLogAnalyticsProber(w http.ResponseWriter, r *http.Request) *loganalytics
6161
prober.QueryConfig = Config
6262
prober.Conf = Opts
6363
prober.UserAgent = UserAgent + gitTag
64-
prober.Azure.Client = AzureClient
64+
prober.SetAzureClient(AzureClient)
6565
prober.EnableCache(metricCache)
6666

6767
return prober

0 commit comments

Comments
 (0)