@@ -12,37 +12,12 @@ import (
12
12
"github.com/scaleway/scaleway-sdk-go/scw"
13
13
)
14
14
15
- type KubeconfigStruct struct {
16
- APIVersion string `yaml:"apiVersion"`
17
- Clusters []struct {
18
- Name string `yaml:"name"`
19
- Cluster struct {
20
- CertificateAuthorityData string `yaml:"certificate-authority-data"`
21
- Server string `yaml:"server"`
22
- } `yaml:"cluster"`
23
- } `yaml:"clusters"`
24
- Contexts []struct {
25
- Name string `yaml:"name"`
26
- Context struct {
27
- Cluster string `yaml:"cluster"`
28
- User string `yaml:"user"`
29
- } `yaml:"context"`
30
- } `yaml:"contexts"`
31
- Kind string `yaml:"kind"`
32
- Users []struct {
33
- Name string `yaml:"name"`
34
- User struct {
35
- Token string `yaml:"token"`
36
- } `yaml:"user"`
37
- } `yaml:"users"`
38
- }
39
-
40
15
const (
41
16
defaultK8SClusterTimeout = 10 * time .Minute
42
17
defaultK8SPoolTimeout = 10 * time .Minute
43
- K8SClusterWaitForPoolRequiredTimeout = 10 * time .Minute
44
- K8SClusterWaitForDeletedTimeout = 10 * time .Minute
45
- K8SPoolWaitForReadyTimeout = 15 * time .Minute
18
+ k8sClusterWaitForPoolRequiredTimeout = 10 * time .Minute
19
+ k8sClusterWaitForDeletedTimeout = 10 * time .Minute
20
+ k8sPoolWaitForReadyTimeout = 15 * time .Minute
46
21
)
47
22
48
23
func k8sAPIWithRegion (d * schema.ResourceData , m interface {}) (* k8s.API , scw.Region , error ) {
@@ -106,7 +81,7 @@ func waitK8SCluster(ctx context.Context, k8sAPI *k8s.API, region scw.Region, clu
106
81
return k8sAPI .WaitForCluster (& k8s.WaitForClusterRequest {
107
82
ClusterID : clusterID ,
108
83
Region : region ,
109
- Timeout : scw .TimeDurationPtr (K8SClusterWaitForPoolRequiredTimeout ),
84
+ Timeout : scw .TimeDurationPtr (k8sClusterWaitForPoolRequiredTimeout ),
110
85
RetryInterval : DefaultWaitRetryInterval ,
111
86
}, scw .WithContext (ctx ))
112
87
}
@@ -115,7 +90,7 @@ func waitK8SClusterPool(ctx context.Context, k8sAPI *k8s.API, region scw.Region,
115
90
return k8sAPI .WaitForClusterPool (& k8s.WaitForClusterRequest {
116
91
ClusterID : clusterID ,
117
92
Region : region ,
118
- Timeout : scw .TimeDurationPtr (K8SClusterWaitForPoolRequiredTimeout ),
93
+ Timeout : scw .TimeDurationPtr (k8sClusterWaitForPoolRequiredTimeout ),
119
94
RetryInterval : DefaultWaitRetryInterval ,
120
95
}, scw .WithContext (ctx ))
121
96
}
@@ -124,7 +99,7 @@ func waitK8SClusterDeleted(ctx context.Context, k8sAPI *k8s.API, region scw.Regi
124
99
cluster , err := k8sAPI .WaitForCluster (& k8s.WaitForClusterRequest {
125
100
ClusterID : clusterID ,
126
101
Region : region ,
127
- Timeout : scw .TimeDurationPtr (K8SClusterWaitForDeletedTimeout ),
102
+ Timeout : scw .TimeDurationPtr (k8sClusterWaitForDeletedTimeout ),
128
103
RetryInterval : DefaultWaitRetryInterval ,
129
104
}, scw .WithContext (ctx ))
130
105
if err != nil {
@@ -141,7 +116,7 @@ func waitK8SPoolReady(ctx context.Context, k8sAPI *k8s.API, region scw.Region, p
141
116
pool , err := k8sAPI .WaitForPool (& k8s.WaitForPoolRequest {
142
117
PoolID : poolID ,
143
118
Region : region ,
144
- Timeout : scw .TimeDurationPtr (K8SPoolWaitForReadyTimeout ),
119
+ Timeout : scw .TimeDurationPtr (k8sPoolWaitForReadyTimeout ),
145
120
RetryInterval : DefaultWaitRetryInterval ,
146
121
}, scw .WithContext (ctx ))
147
122
0 commit comments