mirror of
https://github.com/traefik/traefik
synced 2026-02-03 11:10:33 +00:00
Do not fail when pod is not found in K8sAttributesDetector
This commit is contained in:
committed by
GitHub
parent
6e0012cb0a
commit
b4847d74bc
@@ -53,7 +53,7 @@ func (K8sAttributesDetector) Detect(ctx context.Context) (*resource.Resource, er
|
||||
podNamespace := string(podNamespaceBytes)
|
||||
|
||||
pod, err := client.CoreV1().Pods(podNamespace).Get(ctx, podName, metav1.GetOptions{})
|
||||
if err != nil && kerror.IsForbidden(err) {
|
||||
if err != nil && (kerror.IsForbidden(err) || kerror.IsNotFound(err)) {
|
||||
log.Error().Err(err).Msg("Unable to build K8s resource attributes for Traefik pod")
|
||||
return resource.Empty(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user