5
5
"bytes"
6
6
"encoding/json"
7
7
"fmt"
8
- "github.com/cyclops-ui/cycops-ctrl/internal/auth"
9
- "github.com/go-git/go-git/v5/plumbing/transport/http"
10
8
"io"
11
9
path2 "path"
12
10
"path/filepath"
@@ -17,11 +15,13 @@ import (
17
15
"github.com/go-git/go-git/v5"
18
16
"github.com/go-git/go-git/v5/config"
19
17
"github.com/go-git/go-git/v5/plumbing"
18
+ "github.com/go-git/go-git/v5/plumbing/transport/http"
20
19
"github.com/go-git/go-git/v5/storage/memory"
21
20
"github.com/pkg/errors"
22
21
"gopkg.in/yaml.v2"
23
22
"helm.sh/helm/v3/pkg/chart"
24
23
24
+ "github.com/cyclops-ui/cycops-ctrl/internal/auth"
25
25
"github.com/cyclops-ui/cycops-ctrl/internal/mapper"
26
26
"github.com/cyclops-ui/cycops-ctrl/internal/models"
27
27
"github.com/cyclops-ui/cycops-ctrl/internal/models/helm"
@@ -33,7 +33,7 @@ func (r Repo) LoadTemplate(repoURL, path, commit string) (*models.Template, erro
33
33
return nil , err
34
34
}
35
35
36
- commitSHA , err := r . resolveRef (repoURL , commit , creds )
36
+ commitSHA , err := resolveRef (repoURL , commit , creds )
37
37
if err != nil {
38
38
return nil , err
39
39
}
@@ -139,7 +139,7 @@ func (r Repo) LoadInitialTemplateValues(repoURL, path, commit string) (map[inter
139
139
return nil , err
140
140
}
141
141
142
- commitSHA , err := r . resolveRef (repoURL , commit , creds )
142
+ commitSHA , err := resolveRef (repoURL , commit , creds )
143
143
if err != nil {
144
144
return nil , err
145
145
}
@@ -204,9 +204,9 @@ func (r Repo) LoadInitialTemplateValues(repoURL, path, commit string) (map[inter
204
204
return initialValues , nil
205
205
}
206
206
207
- func ( r Repo ) resolveRef (repo , version string , creds * auth.Credentials ) (string , error ) {
207
+ func resolveRef (repo , version string , creds * auth.Credentials ) (string , error ) {
208
208
if len (version ) == 0 {
209
- return r . resolveDefaultBranchRef (repo , creds )
209
+ return resolveDefaultBranchRef (repo , creds )
210
210
}
211
211
212
212
rem := git .NewRemote (memory .NewStorage (), & config.RemoteConfig {
@@ -233,7 +233,7 @@ func (r Repo) resolveRef(repo, version string, creds *auth.Credentials) (string,
233
233
return version , nil
234
234
}
235
235
236
- func ( r Repo ) resolveDefaultBranchRef (repo string , creds * auth.Credentials ) (string , error ) {
236
+ func resolveDefaultBranchRef (repo string , creds * auth.Credentials ) (string , error ) {
237
237
rem := git .NewRemote (memory .NewStorage (), & config.RemoteConfig {
238
238
Name : "origin" ,
239
239
URLs : []string {repo },
0 commit comments