Skip to content

Commit

Permalink
passing logger server to bitbucket client as quick fix for weaveworks…
Browse files Browse the repository at this point in the history
  • Loading branch information
enekofb authored and yiannistri committed May 25, 2023
1 parent ee8117a commit 2f55fb7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/git/bitbucket_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (p *BitBucketServerProvider) Setup(opts ProviderOption) error {
ggpOpts := []gitprovider.ClientOption{
gitprovider.WithDomain(opts.Hostname),
gitprovider.WithConditionalRequests(opts.ConditionalRequests),
gitprovider.WithLogger(&p.log),
}

var err error
Expand Down
24 changes: 24 additions & 0 deletions pkg/git/bitbucket_server_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package git

import (
"github.com/go-logr/logr/testr"
"github.com/stretchr/testify/require"
"testing"
)

func TestCreateBitbucketServerClient(t *testing.T) {

hostname := "https://my-bit-bucket-server/scm/flux/fleet-tenants-irsa.git"
token := "myToken"
tokenType := "myTokenType"

providerOpts := []ProviderWithFn{}

providerOpts = append(providerOpts, WithUsername("git"))
providerOpts = append(providerOpts, WithToken(tokenType, token))
providerOpts = append(providerOpts, WithDomain(hostname))
providerOpts = append(providerOpts, WithConditionalRequests())

_, err := NewFactory(testr.New(t)).Create(BitBucketServerProviderName, providerOpts...)
require.NoError(t, err)
}

0 comments on commit 2f55fb7

Please sign in to comment.