@@ -2,7 +2,6 @@ package codefresh
22
33import (
44 "context"
5- "errors"
65 "fmt"
76
87 "github.com/codefresh-io/go-sdk/pkg/codefresh/model"
1716 Delete (ctx context.Context , runtimeName string ) (int , error )
1817 DeleteManaged (ctx context.Context , runtimeName string ) (int , error )
1918 SetSharedConfigRepo (ctx context.Context , suggestedSharedConfigRepo string ) (string , error )
20- ResetSharedConfigRepo (ctx context.Context ) error
19+ MigrateRuntime (ctx context.Context , runtimeName string ) error
2120 }
2221
2322 argoRuntime struct {
@@ -318,6 +317,26 @@ func (r *argoRuntime) SetSharedConfigRepo(ctx context.Context, suggestedSharedCo
318317 return res .Data .SuggestIscRepo , nil
319318}
320319
321- func (r * argoRuntime ) ResetSharedConfigRepo (ctx context.Context ) error {
322- return errors .New ("DEPRECATED: use UpdateCsdpSettings instead" )
320+ func (r * argoRuntime ) MigrateRuntime (ctx context.Context , runtimeName string ) error {
321+ jsonData := map [string ]interface {}{
322+ "query" : `
323+ mutation migrateRuntime($runtimeName: String!) {
324+ migrateRuntime(runtimeName: $runtimeName)
325+ }
326+ ` ,
327+ "variables" : map [string ]interface {}{
328+ "runtimeName" : runtimeName ,
329+ },
330+ }
331+ res := & graphqlVoidResponse {}
332+ err := r .codefresh .graphqlAPI (ctx , jsonData , res )
333+ if err != nil {
334+ return fmt .Errorf ("failed making a graphql API call to migrate runtime: %w" , err )
335+ }
336+
337+ if len (res .Errors ) > 0 {
338+ return graphqlErrorResponse {errors : res .Errors }
339+ }
340+
341+ return nil
323342}
0 commit comments