Skip to content

Commit

Permalink
klog: fix formatting
Browse files Browse the repository at this point in the history
Fix wrong use of formats which somehow sneaked in up until now.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Feb 21, 2024
1 parent 21e79c2 commit 9102ac9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/resource-topology-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {
klog.Infof("terminal pods are filtered from the PodResourcesLister client")
cli, err = terminalpods.NewFromLister(context.TODO(), cli, k8scli, time.Minute, parsedArgs.Global.Debug)
if err != nil {
klog.Fatalf("failed to get PodResourceAPI client: %w", err)
klog.Fatalf("failed to get PodResourceAPI client: %v", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/server/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func PortFromEnv() int {
}
port, err := strconv.Atoi(envValue)
if err != nil {
klog.Warningf("the env variable METRICS_PORT has inccorrect value %q: %w", envValue, err)
klog.Warningf("the env variable METRICS_PORT has inccorrect value %q: %v", envValue, err)
return 0
}
return port
Expand Down
4 changes: 2 additions & 2 deletions pkg/podres/middleware/podexclude/podexclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ func ShouldExclude(podExcludes List, namespace, name string, debug bool) bool {
for _, item := range podExcludes {
nsMatch, err := filepath.Match(item.NamespacePattern, namespace)
if err != nil && debug {
klog.Warningf("match error: namespace glob=%q pod=%s/%: %v", item.NamespacePattern, namespace, name, err)
klog.Warningf("match error: namespace glob=%q pod=%s/%s: %v", item.NamespacePattern, namespace, name, err)
continue
}
if !nsMatch {
continue
}
nMatch, err := filepath.Match(item.NamePattern, name)
if err != nil && debug {
klog.Warningf("match error: name glob=%q pod=%s/%: %v", item.NamePattern, namespace, name, err)
klog.Warningf("match error: name glob=%q pod=%s/%s: %v", item.NamePattern, namespace, name, err)
continue
}
if !nMatch {
Expand Down

0 comments on commit 9102ac9

Please sign in to comment.