mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Fix Stackdriver Logging tests for large clusters
This commit is contained in:
parent
bef5cf386e
commit
dca2b5ffdd
@ -20,7 +20,6 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
@ -210,13 +209,8 @@ func (p *sdLogProvider) buildFilter() (string, error) {
|
|||||||
return fmt.Sprintf("resource.type=\"gke_cluster\" AND jsonPayload.metadata.namespace=\"%s\"",
|
return fmt.Sprintf("resource.type=\"gke_cluster\" AND jsonPayload.metadata.namespace=\"%s\"",
|
||||||
p.framework.Namespace.Name), nil
|
p.framework.Namespace.Name), nil
|
||||||
case systemScope:
|
case systemScope:
|
||||||
nodeFilters := []string{}
|
// TODO(instrumentation): Filter logs from the current project only.
|
||||||
for _, nodeID := range utils.GetNodeIds(p.framework.ClientSet) {
|
return "resource.type=\"gce_instance\"", nil
|
||||||
nodeFilter := fmt.Sprintf("resource.labels.instance_id=%s", nodeID)
|
|
||||||
nodeFilters = append(nodeFilters, nodeFilter)
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("resource.type=\"gce_instance\" AND (%s)",
|
|
||||||
strings.Join(nodeFilters, " OR ")), nil
|
|
||||||
}
|
}
|
||||||
return "", fmt.Errorf("Unknown log provider scope: %v", p.scope)
|
return "", fmt.Errorf("Unknown log provider scope: %v", p.scope)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user