1
- // Copyright 2023 The Codefresh Authors.
1
+ // Copyright 2024 The Codefresh Authors.
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ import (
41
41
apfs "github.com/argoproj-labs/argocd-autopilot/pkg/fs"
42
42
apgit "github.com/argoproj-labs/argocd-autopilot/pkg/git"
43
43
aputil "github.com/argoproj-labs/argocd-autopilot/pkg/util"
44
- platmodel "github.com/codefresh-io/go-sdk/pkg/codefresh/ model"
44
+ platmodel "github.com/codefresh-io/go-sdk/pkg/model/platform "
45
45
"github.com/manifoldco/promptui"
46
46
"github.com/spf13/cobra"
47
47
"github.com/spf13/pflag"
@@ -204,7 +204,7 @@ func ensureRuntimeName(ctx context.Context, args []string, filter func(runtime *
204
204
}
205
205
206
206
func getRuntimeNameFromUserSelect (ctx context.Context , filter func (runtime * platmodel.Runtime ) bool ) (string , error ) {
207
- runtimes , err := cfConfig .NewClient ().V2 ().Runtime ().List (ctx )
207
+ runtimes , err := cfConfig .NewClient ().GraphQL ().Runtime ().List (ctx )
208
208
if err != nil {
209
209
return "" , err
210
210
}
@@ -226,7 +226,7 @@ func getRuntimeNameFromUserSelect(ctx context.Context, filter func(runtime *plat
226
226
}
227
227
228
228
templates := & promptui.SelectTemplates {
229
- Active : fmt .Sprintf ("%s {{ .Metadata.Name | underline }}{{ if ne .InstallationType \" HELM\" }}{{ printf \" (%%s)\" .InstallationType | underline }}{{ end }}" , promptui .IconSelect ),
229
+ Active : fmt .Sprintf ("%s {{ .Metadata.Name | underline }}{{ if ne .InstallationType \" HELM\" }}{{ printf \" (%%s)\" .InstallationType | underline }}{{ end }}" , promptui .IconSelect ),
230
230
Inactive : " {{ .Metadata.Name }}{{ if ne .InstallationType \" HELM\" }}{{ printf \" (%s)\" .InstallationType }}{{ end }}" ,
231
231
Selected : "{{ .Metadata.Name | yellow }}" ,
232
232
}
@@ -721,7 +721,7 @@ func isValidationError(err error) bool {
721
721
}
722
722
723
723
func getIscRepo (ctx context.Context ) (string , error ) {
724
- currentUser , err := cfConfig .NewClient ().V2 ().UsersV2 ().GetCurrent (ctx )
724
+ currentUser , err := cfConfig .NewClient ().GraphQL ().User ().GetCurrent (ctx )
725
725
if err != nil {
726
726
return "" , fmt .Errorf ("failed to get current user from platform: %w" , err )
727
727
}
@@ -734,7 +734,7 @@ func getIscRepo(ctx context.Context) (string, error) {
734
734
}
735
735
736
736
func suggestIscRepo (ctx context.Context , suggestedSharedConfigRepo string ) (string , error ) {
737
- setIscRepoResponse , err := cfConfig .NewClient ().V2 ().Runtime ().SetSharedConfigRepo (ctx , suggestedSharedConfigRepo )
737
+ setIscRepoResponse , err := cfConfig .NewClient ().GraphQL ().Runtime ().SetSharedConfigRepo (ctx , suggestedSharedConfigRepo )
738
738
if err != nil {
739
739
return "" , fmt .Errorf ("failed to set shared config repo. Error: %w" , err )
740
740
}
@@ -769,7 +769,7 @@ func ensureRuntimeOnKubeContext(ctx context.Context, kubeconfig string, runtimeN
769
769
}
770
770
771
771
func getRuntime (ctx context.Context , runtimeName string ) (* platmodel.Runtime , error ) {
772
- rt , err := cfConfig .NewClient ().V2 ().Runtime ().Get (ctx , runtimeName )
772
+ rt , err := cfConfig .NewClient ().GraphQL ().Runtime ().Get (ctx , runtimeName )
773
773
if err != nil {
774
774
return nil , fmt .Errorf ("failed to get runtime from platform. error: %w" , err )
775
775
}
0 commit comments