Skip to content
Open
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
8 changes: 8 additions & 0 deletions Sources/ContainerK8s/Support/K8sHelper+Bootstrap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ extension K8sHelper {
throw ContainerizationError(.internalError, message: "write kubeadm config failed on \(nodeID): \(r.output)")
}

r = try await execCapture(
containerId: nodeID, executable: "/bin/sh",
arguments: ["-c", "mkdir -p /kind && ln -sf /etc/kubernetes/kubeadm-config.yaml /kind/kubeadm.conf"],
client: client)
guard r.code == 0 else {
throw ContainerizationError(.internalError, message: "failed to link kind kubeadm config on \(nodeID): \(r.output)")
}

log.info("Running kubeadm init", metadata: ["node": "\(nodeID)"])
r = try await execCapture(
containerId: nodeID, executable: kubeadmPath,
Expand Down
3 changes: 3 additions & 0 deletions Tests/IntegrationTests/K8s/TestK8sRunSerial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ struct TestK8sRunSerial {
print("[k8s-run] container status=\(containerStatus)")
#expect(containerStatus == "running")

let checkResult = try f.run(["exec", name, "test", "-f", "/kind/kubeadm.conf"])
#expect(checkResult.status == 0)

let kubeconfig = try loadKubeconfig()

let clusters = (kubeconfig["clusters"] as? [[String: Any]]) ?? []
Expand Down