diff --git a/internal/mode/static/telemetry/collector.go b/internal/mode/static/telemetry/collector.go index 17fc8f1fed..757e2528be 100644 --- a/internal/mode/static/telemetry/collector.go +++ b/internal/mode/static/telemetry/collector.go @@ -292,10 +292,11 @@ func collectClusterInformation(ctx context.Context, k8sClient client.Reader) (cl } node := nodes.Items[0] - clusterInfo.Version = "unknown" kubeletVersion := node.Status.NodeInfo.KubeletVersion version, err := k8sversion.ParseGeneric(kubeletVersion) - if err == nil { + if err != nil { + clusterInfo.Version = "unknown" + } else { clusterInfo.Version = version.String() } diff --git a/internal/mode/static/telemetry/platform.go b/internal/mode/static/telemetry/platform.go index 858c951a21..ff63117c70 100644 --- a/internal/mode/static/telemetry/platform.go +++ b/internal/mode/static/telemetry/platform.go @@ -69,7 +69,7 @@ func getPlatform(node v1.Node, namespaces v1.NamespaceList) string { func openShiftExtractor(state k8sState) string { // openshift platform won't show up in node's ProviderID - if value, ok := state.node.Labels[openshiftIdentifier]; ok && value != "" { + if state.node.Labels[openshiftIdentifier] != "" { return platformOpenShift }