Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions scaleway/helpers_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,17 @@ func waitK8SClusterDeleted(ctx context.Context, k8sAPI *k8s.API, region scw.Regi
retryInterval = *DefaultWaitRetryInterval
}

cluster, err := k8sAPI.WaitForCluster(&k8s.WaitForClusterRequest{
_, err := k8sAPI.WaitForCluster(&k8s.WaitForClusterRequest{
ClusterID: clusterID,
Region: region,
Status: k8s.ClusterStatusDeleted,
Timeout: scw.TimeDurationPtr(timeout),
RetryInterval: &retryInterval,
}, scw.WithContext(ctx))
if err != nil {
if is404Error(err) {
return nil
}
if err != nil && !is404Error(err) {
return err
}

if cluster.Status != k8s.ClusterStatusDeleted {
return fmt.Errorf("cluster %s has state %s, wants %s", clusterID, cluster.Status, k8s.ClusterStatusDeleted)
}
return nil
}

Expand Down
1,081 changes: 574 additions & 507 deletions scaleway/testdata/data-source-k8s-cluster-basic.cassette.yaml

Large diffs are not rendered by default.

2,928 changes: 2,207 additions & 721 deletions scaleway/testdata/data-source-k8s-pool-basic.cassette.yaml

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions scaleway/testdata/data-source-k8s-version-basic.cassette.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -31,7 +31,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- c5b11d18-0441-4251-b946-a087045474dd
- cfc0ebd7-b8b9-4cdf-9bfe-84286b7d44ad
status: 200 OK
code: 200
duration: ""
Expand All @@ -45,17 +45,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -65,7 +65,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 19d62cb1-e4da-45d0-8862-12c462ad7b77
- 826ca1c4-2601-4642-84d6-d777963cf3d6
status: 200 OK
code: 200
duration: ""
Expand All @@ -79,17 +79,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -99,7 +99,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 7a6cd4ac-997a-4d2e-8b57-20e7be7cfda0
- 5aa10bab-2378-465b-91ca-0cbf46eb12ec
status: 200 OK
code: 200
duration: ""
Expand All @@ -113,17 +113,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -133,7 +133,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 142edf57-7153-42ab-9611-113024f89d76
- f569dccf-a4f8-4fed-aa10-39991d5af342
status: 200 OK
code: 200
duration: ""
Expand All @@ -147,17 +147,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -167,7 +167,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 5cff89d9-501f-4afc-a06c-933d772e21b5
- 9d2fe15b-2a95-4f8e-abc1-6e290cde1bcc
status: 200 OK
code: 200
duration: ""
Expand All @@ -181,17 +181,17 @@ interactions:
url: https://api.scaleway.com/k8s/v1/regions/fr-par/versions/1.26.2
method: GET
response:
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":["none"],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
body: '{"available_admission_plugins":["PodNodeSelector","AlwaysPullImages","PodTolerationRestriction"],"available_cnis":["cilium","calico","kilo"],"available_container_runtimes":["containerd"],"available_feature_gates":["HPAScaleToZero","GRPCContainerProbe","ReadWriteOncePod","ValidatingAdmissionPolicy","CSINodeExpandSecret"],"available_ingresses":[],"available_kubelet_args":{"containerLogMaxFiles":"uint16","containerLogMaxSize":"quantity","cpuCFSQuota":"bool","cpuCFSQuotaPeriod":"duration","cpuManagerPolicy":"enum:none|static","enableDebuggingHandlers":"bool","imageGCHighThresholdPercent":"uint32","imageGCLowThresholdPercent":"uint32","maxPods":"uint16"},"label":"Kubernetes
1.26.2","name":"1.26.2","region":"fr-par"}'
headers:
Content-Length:
- "726"
- "720"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Wed, 19 Jul 2023 12:08:40 GMT
- Wed, 20 Dec 2023 16:18:14 GMT
Server:
- Scaleway API-Gateway
Strict-Transport-Security:
Expand All @@ -201,7 +201,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 7a4cbbcb-64ad-48f0-baca-f4335d482751
- 256fc2db-0a57-47c6-aee5-828670acf620
status: 200 OK
code: 200
duration: ""
Loading