@@ -2,7 +2,6 @@ package codefresh
2
2
3
3
import (
4
4
"context"
5
- "errors"
6
5
"fmt"
7
6
8
7
"github.com/codefresh-io/go-sdk/pkg/codefresh/model"
17
16
Delete (ctx context.Context , runtimeName string ) (int , error )
18
17
DeleteManaged (ctx context.Context , runtimeName string ) (int , error )
19
18
SetSharedConfigRepo (ctx context.Context , suggestedSharedConfigRepo string ) (string , error )
20
- ResetSharedConfigRepo (ctx context.Context ) error
19
+ MigrateRuntime (ctx context.Context , runtimeName string ) error
21
20
}
22
21
23
22
argoRuntime struct {
@@ -318,6 +317,26 @@ func (r *argoRuntime) SetSharedConfigRepo(ctx context.Context, suggestedSharedCo
318
317
return res .Data .SuggestIscRepo , nil
319
318
}
320
319
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
323
342
}
0 commit comments