Skip to content

Commit 9e7a222

Browse files
mads-hartmannArthurSens
authored andcommitted
Add preview.k3s_successfully_created
1 parent 6d39f0e commit 9e7a222

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.werft/jobs/build/deploy-to-preview-environment.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon
105105
exec(`kubectl --kubeconfig ${CORE_DEV_KUBECONFIG_PATH} get secret ${withVM ? 'preview-envs-authproviders-harvester' : 'preview-envs-authproviders'} --namespace=keys -o jsonpath="{.data.authProviders}" > auth-provider-secret.yml`, { silent: true })
106106

107107
if (withVM) {
108+
// We set it to false as default and only set it to true once the k3s cluster is ready.
109+
// We only set the attribute for jobs where a VM is expected.
110+
werft.rootSpan.setAttributes({'preview.k3s_successfully_created': false})
111+
108112
werft.phase(phases.VM, "Ensuring VM is ready for deployment");
109113

110114
werft.log(vmSlices.VM_READINESS, 'Wait for VM readiness')
@@ -122,6 +126,7 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon
122126
werft.log(vmSlices.WAIT_K3S, 'Wait for k3s')
123127
await waitForApiserver(PREVIEW_K3S_KUBECONFIG_PATH, { slice: vmSlices.WAIT_K3S })
124128
await waitUntilAllPodsAreReady("kube-system", PREVIEW_K3S_KUBECONFIG_PATH, { slice: vmSlices.WAIT_K3S })
129+
werft.rootSpan.setAttributes({'preview.k3s_successfully_created': true})
125130
werft.done(vmSlices.WAIT_K3S)
126131

127132
werft.log(vmSlices.WAIT_CERTMANAGER, 'Wait for Cert-Manager')

0 commit comments

Comments
 (0)