Skip to content

Commit 792dd09

Browse files
CR-15158 (#449)
* CR-15158 * wip
1 parent b770df1 commit 792dd09

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.50.0
1+
0.51.0

pkg/codefresh/argo_runtime.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type (
1616
Delete(ctx context.Context, runtimeName string) (int, error)
1717
DeleteManaged(ctx context.Context, runtimeName string) (int, error)
1818
SetSharedConfigRepo(ctx context.Context, suggestedSharedConfigRepo string) (string, error)
19+
ResetSharedConfigRepo(ctx context.Context) error
1920
}
2021

2122
argoRuntime struct {
@@ -64,13 +65,16 @@ type (
6465
Errors []graphqlError
6566
}
6667

67-
6868
graphQlSuggestIscRepoResponse struct {
6969
Data struct {
7070
SuggestIscRepo string
7171
}
7272
Errors []graphqlError
7373
}
74+
75+
graphQlResetIscRepoResponse struct {
76+
Errors []graphqlError
77+
}
7478
)
7579

7680
func newArgoRuntimeAPI(codefresh *codefresh) IRuntimeAPI {
@@ -314,3 +318,24 @@ func (r *argoRuntime) SetSharedConfigRepo(ctx context.Context, suggestedSharedCo
314318

315319
return res.Data.SuggestIscRepo, nil
316320
}
321+
322+
func (r *argoRuntime) ResetSharedConfigRepo(ctx context.Context) error {
323+
jsonData := map[string]interface{}{
324+
"query": `
325+
mutation resetIscRepo {
326+
resetIscRepo
327+
}
328+
`}
329+
330+
res := &graphQlResetIscRepoResponse{}
331+
err := r.codefresh.graphqlAPI(ctx, jsonData, res)
332+
333+
if err != nil {
334+
fmt.Errorf("failed making a graphql API call while resetting shared config repo: %w", err)
335+
}
336+
337+
if len(res.Errors) > 0 {
338+
return graphqlErrorResponse{errors: res.Errors}
339+
}
340+
return nil
341+
}

0 commit comments

Comments
 (0)