Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions internal/provider/kubernetes/topology_injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import (
"context"
"fmt"
"net/http"

"github.com/go-openapi/jsonpointer"
corev1 "k8s.io/api/core/v1"
Expand All @@ -31,7 +30,7 @@
if err := m.Decoder.Decode(req, binding); err != nil {
klog.Error(err, "decoding binding failed", "request.ObjectKind", req.Object.Object.GetObjectKind())
topologyInjectorEventsTotal.WithFailure(metrics.ReasonError).Increment()
return admission.Errored(http.StatusInternalServerError, err)
return admission.Allowed("internal error, skipped")

Check warning on line 33 in internal/provider/kubernetes/topology_injector.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/topology_injector.go#L33

Added line #L33 was not covered by tests
}

if binding.Target.Name == "" {
Expand All @@ -48,7 +47,7 @@
if err := m.Get(ctx, podName, pod); err != nil {
klog.Error(err, "get pod failed", "pod", podName.String())
topologyInjectorEventsTotal.WithFailure(metrics.ReasonError).Increment()
return admission.Errored(http.StatusInternalServerError, err)
return admission.Allowed("internal error, skipped")

Check warning on line 50 in internal/provider/kubernetes/topology_injector.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/topology_injector.go#L50

Added line #L50 was not covered by tests
}

// Skip non-proxy pods
Expand All @@ -65,7 +64,7 @@
if err := m.Get(ctx, nodeName, node); err != nil {
klog.Error(err, "get node failed", "node", node.Name)
topologyInjectorEventsTotal.WithFailure(metrics.ReasonError).Increment()
return admission.Errored(http.StatusInternalServerError, err)
return admission.Allowed("internal error, skipped")

Check warning on line 67 in internal/provider/kubernetes/topology_injector.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/topology_injector.go#L67

Added line #L67 was not covered by tests
}

var patch string
Expand All @@ -77,7 +76,7 @@
if err := m.Patch(ctx, pod, rawPatch); err != nil {
klog.Error(err, "patch pod failed", "pod", podName.String())
topologyInjectorEventsTotal.WithFailure(metrics.ReasonError).Increment()
return admission.Errored(http.StatusInternalServerError, err)
return admission.Allowed("internal error, skipped")

Check warning on line 79 in internal/provider/kubernetes/topology_injector.go

View check run for this annotation

Codecov / codecov/patch

internal/provider/kubernetes/topology_injector.go#L79

Added line #L79 was not covered by tests
}
klog.V(1).Info("patch pod succeeded", "pod", podName.String())
topologyInjectorEventsTotal.WithSuccess().Increment()
Expand Down
Loading