Skip to content

Commit 2da01c7

Browse files
ArthurSensroboquat
authored andcommitted
Werft: Add attribute that identifies runs with VMs pre-made
Signed-off-by: ArthurSens <[email protected]>
1 parent 1f562b6 commit 2da01c7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.werft/build.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,16 @@ export async function build(context, version) {
332332
if (!existingVM) {
333333
werft.log(vmSlices.BOOT_VM, 'Starting VM')
334334
VM.startVM({ name: destname })
335+
werft.currentPhaseSpan.setAttribute("werft.harvester.created_vm", true)
335336
} else if (cleanSlateDeployment) {
336337
werft.log(vmSlices.BOOT_VM, 'Removing existing namespace')
337338
VM.deleteVM({ name: destname })
338339
werft.log(vmSlices.BOOT_VM, 'Starting VM')
339340
VM.startVM({ name: destname })
341+
werft.currentPhaseSpan.setAttribute("werft.harvester.created_vm", true)
340342
} else {
341343
werft.log(vmSlices.BOOT_VM, 'VM already exists')
344+
werft.currentPhaseSpan.setAttribute("werft.harvester.created_vm", false)
342345
}
343346

344347
werft.log(vmSlices.BOOT_VM, 'Waiting for VM to be ready')

.werft/util/werft.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Werft {
2020
private tracer: Tracer;
2121
public rootSpan: Span;
2222
private sliceSpans: { [slice: string]: Span } = {}
23-
private currentPhaseSpan: Span;
23+
public currentPhaseSpan: Span;
2424

2525
constructor(job: string) {
2626
if (werft) {

0 commit comments

Comments
 (0)