Fix word casing

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
This commit is contained in:
Paulo Gomes 2022-03-15 09:38:42 +00:00 committed by Sunny
parent 4ed54bc359
commit 822788b79e
No known key found for this signature in database
GPG Key ID: 9F3D25DDFF7FA3CF
4 changed files with 8 additions and 8 deletions

View File

@ -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,
})

View File

@ -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.

View File

@ -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,
},
@ -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},
},
},
@ -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{

View File

@ -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
}