Skip to content

Commit

Permalink
Merge pull request #54 from annablender/aks-oms-agent-fix
Browse files Browse the repository at this point in the history
Add checks for misconfigured oms agent
  • Loading branch information
Anna Blendermann committed Feb 25, 2022
2 parents 20612fc + 55fa4bb commit 7eec500
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller/aks-cluster-config-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ func BuildUpstreamClusterState(ctx context.Context, secretsCache wranglerv1.Secr
// set addon monitoring profile
if addonProfile["omsAgent"] != nil {
upstreamSpec.Monitoring = addonProfile["omsAgent"].Enabled

if len(addonProfile["omsAgent"].Config) == 0 {
return nil, fmt.Errorf("cannot set OMS Agent configuration retrieved from Azure")
}
logAnalyticsWorkspaceResourceID := addonProfile["omsAgent"].Config["logAnalyticsWorkspaceResourceID"]

logAnalyticsWorkspaceGroup := matchWorkspaceGroup.FindStringSubmatch(to.String(logAnalyticsWorkspaceResourceID))[1]
Expand Down

0 comments on commit 7eec500

Please sign in to comment.