@@ -281,8 +281,8 @@ func getIngressClassFromUserSelect(ingressClassNames []string) (string, error) {
281
281
return result , nil
282
282
}
283
283
284
- // ensureGitToken gets the runtime token from the user (if !silent), and verifys it witht he provider (if available)
285
- func ensureGitToken (cmd * cobra.Command , gitProvider cfgit.Provider , cloneOpts * apgit.CloneOptions ) error {
284
+ // ensureGitRuntimeToken gets the runtime token from the user (if !silent), and verifys it with he provider (if available)
285
+ func ensureGitRuntimeToken (cmd * cobra.Command , gitProvider cfgit.Provider , cloneOpts * apgit.CloneOptions ) error {
286
286
ctx := cmd .Context ()
287
287
errMessage := "Value stored in environment variable GIT_TOKEN is invalid; enter a valid runtime token: %w"
288
288
if cloneOpts .Auth .Password == "" && ! store .Get ().Silent {
@@ -294,7 +294,7 @@ func ensureGitToken(cmd *cobra.Command, gitProvider cfgit.Provider, cloneOpts *a
294
294
}
295
295
296
296
if gitProvider != nil {
297
- err := gitProvider .VerifyToken (ctx , cfgit . RuntimeToken , cloneOpts .Auth .Password )
297
+ err := gitProvider .VerifyRuntimeToken (ctx , cloneOpts .Auth .Password )
298
298
if err != nil {
299
299
// in case when we get invalid value from env variable TOKEN we clean
300
300
cloneOpts .Auth .Password = ""
@@ -307,8 +307,8 @@ func ensureGitToken(cmd *cobra.Command, gitProvider cfgit.Provider, cloneOpts *a
307
307
return nil
308
308
}
309
309
310
- // ensureGitPAT verifys the user's Personal Access Token (if it is different from the Runtime Token)
311
- func ensureGitPAT (ctx context.Context , opts * RuntimeInstallOptions ) error {
310
+ // ensureGitUserToken verifys the user's Personal Access Token (if it is different from the Runtime Token)
311
+ func ensureGitUserToken (ctx context.Context , opts * RuntimeInstallOptions ) error {
312
312
if opts .GitIntegrationRegistrationOpts .Token == "" {
313
313
opts .GitIntegrationRegistrationOpts .Token = opts .InsCloneOpts .Auth .Password
314
314
currentUser , err := cfConfig .NewClient ().Users ().GetCurrent (ctx )
@@ -321,7 +321,7 @@ func ensureGitPAT(ctx context.Context, opts *RuntimeInstallOptions) error {
321
321
}
322
322
323
323
if opts .gitProvider != nil {
324
- return opts .gitProvider .VerifyToken (ctx , cfgit . PersonalToken , opts .InsCloneOpts . Auth . Password )
324
+ return opts .gitProvider .VerifyUserToken (ctx , opts .GitIntegrationRegistrationOpts . Token )
325
325
}
326
326
327
327
return nil
@@ -566,7 +566,7 @@ func checkIngressHostWithInsecure(ingress string) bool {
566
566
customTransport := http .DefaultTransport .(* http.Transport ).Clone ()
567
567
customTransport .TLSClientConfig = & tls.Config {InsecureSkipVerify : true }
568
568
httpClient .Transport = customTransport
569
- req , err := http .NewRequest ("GET" , ingress , nil )
569
+ req , err := http .NewRequest (http . MethodGet , ingress , nil )
570
570
if err != nil {
571
571
return false
572
572
}
0 commit comments