-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(k8s): add marshallers for get versions (#1560)
- Loading branch information
Showing
5 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package k8s | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/scaleway/scaleway-cli/internal/core" | ||
) | ||
|
||
func Test_GetVersion(t *testing.T) { | ||
//// | ||
// Simple use cases | ||
//// | ||
t.Run("simple", core.Test(&core.TestConfig{ | ||
Commands: GetCommands(), | ||
Cmd: "scw k8s version get 1.20.2", | ||
Check: core.TestCheckCombine( | ||
core.TestCheckGolden(), | ||
core.TestCheckExitCode(0), | ||
), | ||
})) | ||
} |
35 changes: 35 additions & 0 deletions
35
internal/namespaces/k8s/v1/testdata/test-get-version-simple.cassette.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- scaleway-sdk-go/v1.0.0-beta.7+dev (go1.15.7; darwin; amd64) cli-e2e-test | ||
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.20.2 | ||
method: GET | ||
response: | ||
body: '{"region":"fr-par","name":"1.20.2","label":"Kubernetes 1.20.2","available_cnis":["cilium","calico","weave","flannel"],"available_ingresses":["none","nginx","traefik","traefik2"],"available_container_runtimes":["containerd","crio","docker"],"available_feature_gates":["TTLAfterFinished","HPAScaleToZero","ServiceTopology","EphemeralContainers","KubeletCredentialProviders","GenericEphemeralVolume"],"available_admission_plugins":["PodSecurityPolicy","PodNodeSelector","AlwaysPullImages","PodPreset","PodTolerationRestriction"],"available_kubelet_args":{"cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","maxPods":"uint16"}}' | ||
headers: | ||
Content-Length: | ||
- "662" | ||
Content-Security-Policy: | ||
- default-src 'none'; frame-ancestors 'none' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Wed, 10 Feb 2021 15:25:17 GMT | ||
Server: | ||
- Scaleway API-Gateway | ||
Strict-Transport-Security: | ||
- max-age=63072000 | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- DENY | ||
X-Request-Id: | ||
- 6b5b146e-bdd6-485f-b38c-a8782f4eba52 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
75 changes: 75 additions & 0 deletions
75
internal/namespaces/k8s/v1/testdata/test-get-version-simple.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
π²π²π² EXIT CODE: 0 π²π²π² | ||
π©π©π© STDOUTοΈ π©π©π©οΈ | ||
Name 1.20.2 | ||
Label Kubernetes 1.20.2 | ||
Region fr-par | ||
|
||
Available Kubelet Arguments: | ||
map[cpuCFSQuota:bool cpuCFSQuotaPeriod:duration cpuManagerPolicy:enum:none|static maxPods:uint16] | ||
|
||
Available CNIs: | ||
- cilium | ||
- calico | ||
- weave | ||
- flannel | ||
|
||
Available Ingresses: | ||
- none | ||
- nginx | ||
- traefik | ||
- traefik2 | ||
|
||
Available Container Runtimes: | ||
- containerd | ||
- crio | ||
- docker | ||
|
||
Available Feature Gates: | ||
[TTLAfterFinished HPAScaleToZero ServiceTopology EphemeralContainers KubeletCredentialProviders GenericEphemeralVolume] | ||
|
||
Available Admission Plugins: | ||
[PodSecurityPolicy PodNodeSelector AlwaysPullImages PodPreset PodTolerationRestriction] | ||
π©π©π© JSON STDOUT π©π©π© | ||
{ | ||
"name": "1.20.2", | ||
"label": "Kubernetes 1.20.2", | ||
"region": "fr-par", | ||
"available_cnis": [ | ||
"cilium", | ||
"calico", | ||
"weave", | ||
"flannel" | ||
], | ||
"available_ingresses": [ | ||
"none", | ||
"nginx", | ||
"traefik", | ||
"traefik2" | ||
], | ||
"available_container_runtimes": [ | ||
"containerd", | ||
"crio", | ||
"docker" | ||
], | ||
"available_feature_gates": [ | ||
"TTLAfterFinished", | ||
"HPAScaleToZero", | ||
"ServiceTopology", | ||
"EphemeralContainers", | ||
"KubeletCredentialProviders", | ||
"GenericEphemeralVolume" | ||
], | ||
"available_admission_plugins": [ | ||
"PodSecurityPolicy", | ||
"PodNodeSelector", | ||
"AlwaysPullImages", | ||
"PodPreset", | ||
"PodTolerationRestriction" | ||
], | ||
"available_kubelet_args": { | ||
"cpuCFSQuota": "bool", | ||
"cpuCFSQuotaPeriod": "duration", | ||
"cpuManagerPolicy": "enum:none|static", | ||
"maxPods": "uint16" | ||
} | ||
} |