1- // Copyright 2023 The Codefresh Authors.
1+ // Copyright 2024 The Codefresh Authors.
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ import (
4141 apfs "github.com/argoproj-labs/argocd-autopilot/pkg/fs"
4242 apgit "github.com/argoproj-labs/argocd-autopilot/pkg/git"
4343 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 "
4545 "github.com/manifoldco/promptui"
4646 "github.com/spf13/cobra"
4747 "github.com/spf13/pflag"
@@ -204,7 +204,7 @@ func ensureRuntimeName(ctx context.Context, args []string, filter func(runtime *
204204}
205205
206206func 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 )
208208 if err != nil {
209209 return "" , err
210210 }
@@ -226,7 +226,7 @@ func getRuntimeNameFromUserSelect(ctx context.Context, filter func(runtime *plat
226226 }
227227
228228 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 ),
230230 Inactive : " {{ .Metadata.Name }}{{ if ne .InstallationType \" HELM\" }}{{ printf \" (%s)\" .InstallationType }}{{ end }}" ,
231231 Selected : "{{ .Metadata.Name | yellow }}" ,
232232 }
@@ -721,7 +721,7 @@ func isValidationError(err error) bool {
721721}
722722
723723func getIscRepo (ctx context.Context ) (string , error ) {
724- currentUser , err := cfConfig .NewClient ().V2 ().UsersV2 ().GetCurrent (ctx )
724+ currentUser , err := cfConfig .NewClient ().GraphQL ().User ().GetCurrent (ctx )
725725 if err != nil {
726726 return "" , fmt .Errorf ("failed to get current user from platform: %w" , err )
727727 }
@@ -734,7 +734,7 @@ func getIscRepo(ctx context.Context) (string, error) {
734734}
735735
736736func 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 )
738738 if err != nil {
739739 return "" , fmt .Errorf ("failed to set shared config repo. Error: %w" , err )
740740 }
@@ -769,7 +769,7 @@ func ensureRuntimeOnKubeContext(ctx context.Context, kubeconfig string, runtimeN
769769}
770770
771771func 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 )
773773 if err != nil {
774774 return nil , fmt .Errorf ("failed to get runtime from platform. error: %w" , err )
775775 }
0 commit comments