@@ -149,6 +149,7 @@ func (k *KindClusterProvider) createKindCluster() {
149
149
},
150
150
Nodes : []kindv1.Node {
151
151
{
152
+ Role : kindv1 .ControlPlaneRole ,
152
153
ExtraPortMappings : k .extraPortMappings ,
153
154
},
154
155
},
@@ -163,7 +164,10 @@ func (k *KindClusterProvider) createKindCluster() {
163
164
kindv1 .SetDefaultsCluster (cfg )
164
165
165
166
if k .withDockerSock {
166
- setDockerSockConfig (cfg )
167
+ cfg .Nodes [0 ].ExtraMounts = append (cfg .Nodes [0 ].ExtraMounts , kindv1.Mount {
168
+ HostPath : "/var/run/docker.sock" ,
169
+ ContainerPath : "/var/run/docker.sock" ,
170
+ })
167
171
}
168
172
169
173
kindCreateOptions = append (kindCreateOptions , kind .CreateWithV1Alpha4Config (cfg ))
@@ -197,21 +201,6 @@ func (k *KindClusterProvider) createKindCluster() {
197
201
}
198
202
}
199
203
200
- // setDockerSockConfig returns a kind config for mounting /var/run/docker.sock into the kind node.
201
- func setDockerSockConfig (cfg * kindv1.Cluster ) {
202
- cfg .Nodes = []kindv1.Node {
203
- {
204
- Role : kindv1 .ControlPlaneRole ,
205
- ExtraMounts : []kindv1.Mount {
206
- {
207
- HostPath : "/var/run/docker.sock" ,
208
- ContainerPath : "/var/run/docker.sock" ,
209
- },
210
- },
211
- },
212
- }
213
- }
214
-
215
204
// GetKubeconfigPath returns the path to the kubeconfig file for the cluster.
216
205
func (k * KindClusterProvider ) GetKubeconfigPath () string {
217
206
return k .kubeconfigPath
0 commit comments