diff --git a/pkg/client/quay/client.go b/pkg/client/quay/client.go index c24afb5b..f638e974 100644 --- a/pkg/client/quay/client.go +++ b/pkg/client/quay/client.go @@ -8,8 +8,6 @@ import ( "io/ioutil" "net/http" "net/url" - - "github.com/quay/quay-bridge-operator/pkg/utils" ) type QuayClient struct { @@ -172,7 +170,7 @@ func (c *QuayClient) newRequest(method, path string, body interface{}) (*http.Re } req, err := http.NewRequest(method, u.String(), buf) - if !utils.IsZeroOfUnderlyingType(c.AuthToken) { + if c.AuthToken != "" { req.Header.Set("Authorization", "Bearer "+c.AuthToken) } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 7235d338..bc711b5f 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -2,17 +2,12 @@ package utils import ( "fmt" - "reflect" "github.com/quay/quay-bridge-operator/pkg/constants" "github.com/quay/quay-bridge-operator/pkg/logging" corev1 "k8s.io/api/core/v1" ) -func IsZeroOfUnderlyingType(x interface{}) bool { - return reflect.DeepEqual(x, reflect.Zero(reflect.TypeOf(x)).Interface()) -} - func RemoveItemsFromSlice(s []string, r []string) []string { for i, v := range s {