Skip to content

Commit

Permalink
remove cluster name from k8s operators, cluster name is not detectabl…
Browse files Browse the repository at this point in the history
…e from the k8s api
  • Loading branch information
jsirianni committed Dec 18, 2023
1 parent 563ec88 commit c3ec65f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion operator/builtin/input/k8sevent/k8s_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ func (k *K8sEvents) consumeWatchEvents(ctx context.Context, events <-chan watch.
func (k *K8sEvents) populateResource(event *apiv1.Event, entry *entry.Entry) {
io := event.InvolvedObject

entry.AddResourceKey("k8s.cluster.name", event.ClusterName)
entry.AddResourceKey("k8s.namespace.name", io.Namespace)

switch io.Kind {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package k8smetadata

import (
"context"
"net/http"
"net/url"
"sync"
"time"
"net/url"
"net/http"

"github.com/observiq/stanza/entry"
"github.com/observiq/stanza/errors"
Expand Down Expand Up @@ -121,8 +121,8 @@ func (k *K8sMetadataDecorator) Start() error {
)
}

if ! k.allowProxy {
config.Proxy = func (*http.Request) (*url.URL, error) {
if !k.allowProxy {
config.Proxy = func(*http.Request) (*url.URL, error) {
return nil, nil
}
}
Expand Down Expand Up @@ -226,7 +226,6 @@ func (k *K8sMetadataDecorator) refreshNamespaceMetadata(ctx context.Context, nam

// Cache the results
cacheEntry := MetadataCacheEntry{
ClusterName: namespaceResponse.ClusterName,
ExpirationTime: time.Now().Add(k.cacheTTL),
UID: string(namespaceResponse.UID),
Labels: namespaceResponse.Labels,
Expand Down Expand Up @@ -259,7 +258,6 @@ func (k *K8sMetadataDecorator) refreshPodMetadata(ctx context.Context, namespace

// Create the cache entry
cacheEntry := MetadataCacheEntry{
ClusterName: podResponse.ClusterName,
UID: string(podResponse.UID),
ExpirationTime: time.Now().Add(k.cacheTTL),
Labels: podResponse.Labels,
Expand Down

0 comments on commit c3ec65f

Please sign in to comment.