cmd/k8s-operator: fix Tailscale Service API errors check (#16020)
Updates tailscale/tailscale#15895 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
@@ -8,10 +8,8 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand/v2"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"testing"
|
||||
|
||||
@@ -23,7 +21,6 @@ import (
|
||||
"k8s.io/client-go/tools/record"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
||||
"tailscale.com/internal/client/tailscale"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
tsoperator "tailscale.com/k8s-operator"
|
||||
tsapi "tailscale.com/k8s-operator/apis/v1alpha1"
|
||||
@@ -108,8 +105,7 @@ func TestServicePGReconciler_UpdateHostname(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatalf("svc:default-%s not cleaned up", svc.Name)
|
||||
}
|
||||
var errResp *tailscale.ErrResponse
|
||||
if !errors.As(err, &errResp) || errResp.Status != http.StatusNotFound {
|
||||
if !isErrorTailscaleServiceNotFound(err) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user