Skip to content

Commit dc93b08

Browse files
author
Prince Rachit Sinha
committed
Add rollout restart and wait
1 parent 8d029cd commit dc93b08

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.werft/build.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export async function deployToDev(deploymentConfig: DeploymentConfig, workspaceF
398398

399399
if (k3sWsCluster) {
400400
try {
401-
registerK3sWsCluster(namespace, domain, "", getK3sWsKubeConfigPath())
401+
await registerK3sWsCluster(namespace, domain, "", getK3sWsKubeConfigPath())
402402
} catch (err) {
403403
werft.fail(phases.REGISTER_K3S_WS_CLUSTER, err.toString())
404404
}
@@ -601,7 +601,14 @@ export async function triggerIntegrationTests(version: string, namespace: string
601601
}
602602

603603
// Registers a WS cluster to the meta cluster
604-
function registerK3sWsCluster(namespace: string, domain: string, pathToKubeConfigMeta: string, pathToKubeConfigK3s: string) {
604+
async function registerK3sWsCluster(namespace: string, domain: string, pathToKubeConfigMeta: string, pathToKubeConfigK3s: string) {
605+
// When we deploy the ws proxy then certs are not generate. So the pods could go into a long waiting state without kubelet reattempting to mount the volume
606+
// So, we just restart the deployment for secrets to be mounted.
607+
shell.exec(`export KUBECONFIG=${pathToKubeConfigK3s} && kubectl rollout restart deploy ws-proxy -n ${namespace}`)
608+
shell.exec(`export KUBECONFIG=${pathToKubeConfigK3s} && kubectl rollout status deploy ws-proxy -n ${namespace}`)
609+
// explicitly wait for 15s assuming the k3s service would have picked the new ws-proxy pod
610+
await sleep(15000)
611+
605612
gpctl.buildGpctlBinary()
606613

607614
const wsProxyUrl = `ws-k3s.${domain}:8081`

0 commit comments

Comments
 (0)