Skip to content

Commit 26fc8de

Browse files
committed
[processor/resourcedetection] fix when panic when AKS detector is used
Signed-off-by: Dani Louca <[email protected]>
1 parent 6c5baea commit 26fc8de

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# If your change doesn't affect end users, such as a test fix or a tooling change,
3+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
4+
5+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
6+
change_type: bug_fix
7+
8+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
9+
component: processor/resourcedetection
10+
11+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
12+
note: make sure to use a aks config struct instead of nil to avoid collector panic
13+
14+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15+
issues: [24549]
16+
17+
# (Optional) One or more lines of additional information to render under the primary note.
18+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19+
# Use pipe (|) for multiline entries.
20+
subtext:

processor/resourcedetectionprocessor/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ func (d *DetectorConfig) GetConfigFromType(detectorType internal.DetectorType) i
116116
return d.LambdaConfig
117117
case azure.TypeStr:
118118
return d.AzureConfig
119+
case aks.TypeStr:
120+
return d.AksConfig
119121
case consul.TypeStr:
120122
return d.ConsulConfig
121123
case docker.TypeStr:

processor/resourcedetectionprocessor/testdata/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ resourcedetection/openshift:
99
tls:
1010
insecure: true
1111

12+
resourcedetection/aks:
13+
detectors: [ env, aks ]
14+
timeout: 2s
15+
override: false
16+
1217
resourcedetection/gcp:
1318
detectors: [env, gcp]
1419
timeout: 2s

0 commit comments

Comments
 (0)