Skip to content

Commit

Permalink
Fix word casing
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
  • Loading branch information
Paulo Gomes committed Mar 15, 2022
1 parent 9270f96 commit 1664d8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controllers/gitrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
repositoryURL = fmt.Sprintf("http://%s/%s/%d", obj.Name, obj.UID, obj.Generation)
managed.AddTransportOptions(repositoryURL,
managed.TransportOptions{
TargetUrl: obj.Spec.URL,
TargetURL: obj.Spec.URL,
CABundle: authOpts.CAFile,
})

Expand Down
4 changes: 2 additions & 2 deletions pkg/git/libgit2/managed/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func createClientRequest(targetUrl string, action git2go.SmartServiceAction, t *
finalUrl := targetUrl
opts, found := transportOptions(targetUrl)
if found {
if opts.TargetUrl != "" {
if opts.TargetURL != "" {
// override target URL only if options are found and a new targetURL
// is provided.
finalUrl = opts.TargetUrl
finalUrl = opts.TargetURL
}

// Add any provided certificate to the http transport.
Expand Down
8 changes: 4 additions & 4 deletions pkg/git/libgit2/managed/managed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestHttpAction_CreateClientRequest(t *testing.T) {
action: git2go.SmartServiceActionUploadpack,
transport: &http.Transport{},
opts: &TransportOptions{
TargetUrl: "https://final-target",
TargetURL: "https://final-target",
},
wantedErr: nil,
},
Expand Down Expand Up @@ -151,12 +151,12 @@ func TestOptions(t *testing.T) {
registerOpts: true,
url: "https://target/?876",
opts: TransportOptions{
TargetUrl: "https://new-target/321",
TargetURL: "https://new-target/321",
CABundle: []byte{123, 213, 132},
},
expectOpts: true,
expectedOpts: &TransportOptions{
TargetUrl: "https://new-target/321",
TargetURL: "https://new-target/321",
CABundle: []byte{123, 213, 132},
},
},
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestManagedTransport_E2E(t *testing.T) {
// This was the way found to ensure that the built-in transport was not used.
httpAddress := "http://fake-url"
AddTransportOptions(httpAddress, TransportOptions{
TargetUrl: server.HTTPAddress() + "/" + repoPath,
TargetURL: server.HTTPAddress() + "/" + repoPath,
})

repo, err := git2go.Clone(httpAddress, tmpDir, &git2go.CloneOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/git/libgit2/managed/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
// TransportOptions represents options to be applied at transport-level
// at request time.
type TransportOptions struct {
TargetUrl string
TargetURL string
CABundle []byte
}

Expand Down

0 comments on commit 1664d8e

Please sign in to comment.