From cd4b4c42069ccbbff0a48578649495afa8b335b3 Mon Sep 17 00:00:00 2001 From: elad-codefresh Date: Thu, 29 Jul 2021 12:32:03 +0300 Subject: [PATCH 1/4] removed id in Create function mutation --- pkg/codefresh/argo_runtime.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/codefresh/argo_runtime.go b/pkg/codefresh/argo_runtime.go index e18448a..92dca28 100644 --- a/pkg/codefresh/argo_runtime.go +++ b/pkg/codefresh/argo_runtime.go @@ -38,7 +38,6 @@ func newArgoRuntimeAPI(codefresh *codefresh) IArgoRuntimeAPI { func (r *argoRuntime) Create(runtimeName string) (*model.RuntimeCreationResponse, error) { interpolatedMutation := fmt.Sprintf(`mutation { runtime(name: "%s") { - id newAccessToken } } From 4f690779aaa95f2612d5a6c7eba50a73fdd58944 Mon Sep 17 00:00:00 2001 From: elad-codefresh Date: Thu, 29 Jul 2021 12:32:44 +0300 Subject: [PATCH 2/4] bump --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c25c8e5..c173e42 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.30.0 +v0.30.1 From d12867f7fb34a85101d708a0c4042f98b9b66ea2 Mon Sep 17 00:00:00 2001 From: elad-codefresh Date: Fri, 30 Jul 2021 00:37:08 +0300 Subject: [PATCH 3/4] make sure models_gen.go is updated by real generation and not manually --- pkg/codefresh/argo_runtime.go | 21 +++++++++++++-------- pkg/codefresh/model/models_gen.go | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pkg/codefresh/argo_runtime.go b/pkg/codefresh/argo_runtime.go index 92dca28..dc07bf6 100644 --- a/pkg/codefresh/argo_runtime.go +++ b/pkg/codefresh/argo_runtime.go @@ -36,15 +36,16 @@ func newArgoRuntimeAPI(codefresh *codefresh) IArgoRuntimeAPI { } func (r *argoRuntime) Create(runtimeName string) (*model.RuntimeCreationResponse, error) { - interpolatedMutation := fmt.Sprintf(`mutation { - runtime(name: "%s") { - newAccessToken - } - } - `, runtimeName) - jsonData := map[string]interface{}{ - "query": interpolatedMutation, + "query": `mutation CreateRuntime($name: String!) { + runtime(name: $name) { + name + newAccessToken + } + }`, + "variables": map[string]string{ + "name": runtimeName, + }, } response, err := r.codefresh.requestAPI(&requestOptions{ @@ -79,6 +80,10 @@ func (r *argoRuntime) Create(runtimeName string) (*model.RuntimeCreationResponse return &res.Data.Runtime, nil } +// func GetRuntimeName(runtimeName string) string { +// return runtimeName +// } + func (r *argoRuntime) List() ([]model.Runtime, error) { jsonData := map[string]interface{}{ "query": ` diff --git a/pkg/codefresh/model/models_gen.go b/pkg/codefresh/model/models_gen.go index 31bc6df..5e5826b 100644 --- a/pkg/codefresh/model/models_gen.go +++ b/pkg/codefresh/model/models_gen.go @@ -641,7 +641,7 @@ type RuntimeCreationResponse struct { // The runtime access token that will be used for requests from the runtime NewAccessToken string `json:"newAccessToken"` // The id of the newly created runtime - ID string `json:"id"` + Name string `json:"id"` } // Runtime Edge From 81758d5f3c87a6b2018fe70fe07933880b1fc314 Mon Sep 17 00:00:00 2001 From: elad-codefresh Date: Fri, 30 Jul 2021 00:42:33 +0300 Subject: [PATCH 4/4] removed comment --- pkg/codefresh/argo_runtime.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/codefresh/argo_runtime.go b/pkg/codefresh/argo_runtime.go index dc07bf6..19faeeb 100644 --- a/pkg/codefresh/argo_runtime.go +++ b/pkg/codefresh/argo_runtime.go @@ -80,10 +80,6 @@ func (r *argoRuntime) Create(runtimeName string) (*model.RuntimeCreationResponse return &res.Data.Runtime, nil } -// func GetRuntimeName(runtimeName string) string { -// return runtimeName -// } - func (r *argoRuntime) List() ([]model.Runtime, error) { jsonData := map[string]interface{}{ "query": `