-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/resourcedetection] introduce kubeadm detector #35450
base: main
Are you sure you want to change the base?
[processor/resourcedetection] introduce kubeadm detector #35450
Conversation
1bdc2fb
to
3c5422f
Compare
processor/resourcedetectionprocessor/internal/kubeadm/config.go
Outdated
Show resolved
Hide resolved
processor/resourcedetectionprocessor/internal/kubeadm/kubeadm.go
Outdated
Show resolved
Hide resolved
if d.ra.K8sClusterName.Enabled { | ||
clusterName, err := d.provider.ClusterName(ctx) | ||
if err != nil { | ||
return pcommon.NewResource(), "", fmt.Errorf("failed getting k8s cluster name: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, feel free to drop: I'm wondering if it would be better to future-proof this by not returning the error right away, and returning the error at the end.
If we end up adding more resource attributes the existing logic would not record the other, unrelated resource attributes, even if they could be detected and emitted successfully.
5dbc1c7
to
99bf118
Compare
processor/resourcedetectionprocessor/internal/kubeadm/config.go
Outdated
Show resolved
Hide resolved
062d966
to
80bd836
Compare
defaultConfigMapName = "kubeadm-config" | ||
defaultConfigMapNamespace = "kube-system" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Do these defaults need to be in the resource detection processor? Could they instead be moved to internal/metadataproviders/kubeadm/metadata.go? It doesn't appear to be necessary to pass these down to the NewProvider
method, but maybe there's a scenario I'm not thinking of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only scenario would be that we could make the configMap name and namespace configurable in the future. Currently that is not needed at all.
Technically we can move the default values to the internal package you mentioned, but I do not see much advantage technically there. Leaving it up to your decision.
6436f3a
to
0eda211
Compare
@crobert-1 any other suggestions? |
cc @crobert-1 |
aa63a96
to
ad7502e
Compare
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
21ca676
to
9b0389f
Compare
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
@dashpole @Aneurysm9 could you also take a look? |
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left 2 nits. Otherwise LGTM.
Signed-off-by: odubajDT <[email protected]>
Description:
kubeadm
detector to detect local cluster nameLink to tracking Issue: #35116