diff --git a/pkg/registry/apis/provisioning/repository/github/factory.go b/pkg/registry/apis/provisioning/repository/github/factory.go index da2d50a6131..6f2435ee8d0 100644 --- a/pkg/registry/apis/provisioning/repository/github/factory.go +++ b/pkg/registry/apis/provisioning/repository/github/factory.go @@ -12,6 +12,7 @@ import ( // It exists only for the ability to test the code easily. type Factory struct { // Client allows overriding the client to use in the GH client returned. It exists primarily for testing. + // FIXME: we should replace in this way. We should add some options pattern for the factory. Client *http.Client } @@ -28,7 +29,7 @@ func (r *Factory) New(ctx context.Context, ghToken string) Client { &oauth2.Token{AccessToken: ghToken}, ) - if len(ghToken) == 0 { + if len(ghToken) > 0 { tokenClient := oauth2.NewClient(ctx, tokenSrc) return NewClient(github.NewClient(tokenClient)) }