File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ function configureCoreDevAccess() {
63
63
}
64
64
65
65
function decideHarvesterVMCreation ( werft : Werft , config : JobConfig ) {
66
- if ( config . withVM && ! VM . vmExists ( { name : config . previewEnvironment . destname } ) ) {
66
+ const namespace = "preview-" + config . previewEnvironment . destname
67
+ if ( config . withVM && ! VM . vmExists ( { name : namespace } ) ) {
67
68
prepareVM ( werft , config )
68
69
} else {
69
70
werft . currentPhaseSpan . setAttribute ( "werft.harvester.created_vm" , false )
@@ -76,6 +77,7 @@ function prepareVM(werft: Werft, config: JobConfig) {
76
77
werft . log ( prepareSlices . BOOT_VM , "Cleaning previously created VM" )
77
78
VM . deleteVM ( { name : config . previewEnvironment . destname } )
78
79
}
80
+ werft . log ( prepareSlices . BOOT_VM , "Creating VM" )
79
81
createVM ( werft , config , prepareSlices . BOOT_VM )
80
82
}
81
83
Original file line number Diff line number Diff line change @@ -114,8 +114,7 @@ export function startVM(options: { name: string }) {
114
114
* @returns true if the VM already exists
115
115
*/
116
116
export function vmExists ( options : { name : string } ) {
117
- const namespace = `preview-${ options . name } `
118
- const status = exec ( `kubectl --kubeconfig ${ KUBECONFIG_PATH } -n ${ namespace } get vmi ${ options . name } ` , { dontCheckRc : true , silent : true } )
117
+ const status = exec ( `kubectl --kubeconfig ${ KUBECONFIG_PATH } -n preview-${ options . name } get vmi ${ options . name } ` , { dontCheckRc : true , silent : true } )
119
118
return status . code == 0
120
119
}
121
120
You can’t perform that action at this time.
0 commit comments