Skip to content

Commit

Permalink
fix reviews
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Cyvoct <pcyvoct@scaleway.com>
  • Loading branch information
Sh4d1 committed Mar 17, 2020
1 parent e647dde commit 13938d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions internal/namespaces/k8s/v1beta4/custom_version_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ func k8sVersionGetCommand() *core.Command {
}

func k8sVersionGetRun(ctx context.Context, argsI interface{}) (i interface{}, e error) {
args := argsI.(*k8sVersionGetRequest)
request := argsI.(*k8sVersionGetRequest)

client := core.ExtractClient(ctx)
apiK8s := k8s.NewAPI(client)

versions, err := apiK8s.ListVersions(&k8s.ListVersionsRequest{
Region: args.Region,
Region: request.Region,
})

if err != nil {
return nil, err
}

for _, version := range versions.Versions {
if version.Name == args.Version {
if version.Name == request.Version {
return version, nil
}
}
return nil, fmt.Errorf("version '%s' not found", args.Version)
return nil, fmt.Errorf("version '%s' not found", request.Version)
}
3 changes: 2 additions & 1 deletion internal/namespaces/k8s/v1beta4/custom_version_get_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package k8s

import (
"fmt"
"testing"

"github.com/scaleway/scaleway-cli/internal/core"
Expand All @@ -23,7 +24,7 @@ func Test_GetVersion(t *testing.T) {
Commands: GetCommands(),
Cmd: "scw k8s version get test",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckError(fmt.Errorf("version 'test' not found")),
core.TestCheckExitCode(1),
),
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interactions:
Content-Type:
- application/json
Date:
- Tue, 17 Mar 2020 10:46:45 GMT
- Tue, 17 Mar 2020 11:38:15 GMT
Server:
- scaleway_api
Strict-Transport-Security:
Expand All @@ -31,7 +31,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- d94317bb-def1-4259-ad50-1c0b8c9dc003
- d3f5d4f9-44bb-4c0c-8c4a-a82d2251db18
status: 200 OK
code: 200
duration: ""

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interactions:
Content-Type:
- application/json
Date:
- Tue, 17 Mar 2020 10:46:45 GMT
- Tue, 17 Mar 2020 11:38:15 GMT
Server:
- scaleway_api
Strict-Transport-Security:
Expand All @@ -31,7 +31,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- fb59bc0a-a3bc-425b-9db0-4ba947bc6c30
- 7d321500-a3fd-4a89-ab8c-12caab3b8f4c
status: 200 OK
code: 200
duration: ""

0 comments on commit 13938d2

Please sign in to comment.