From 83554e55967843badd146269e8946f75ed01c602 Mon Sep 17 00:00:00 2001 From: Artem Chernyshev Date: Tue, 22 Oct 2024 17:44:33 +0300 Subject: [PATCH] fix: do not set empty initial labels in the UI The check was incorrect, so it was setting empty initial labels even if they are not set in the UI. Signed-off-by: Artem Chernyshev --- client/pkg/infra/controllers/provision.go | 2 ++ frontend/src/views/omni/MachineClasses/MachineClass.vue | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/pkg/infra/controllers/provision.go b/client/pkg/infra/controllers/provision.go index 40139e2a..f64b676a 100644 --- a/client/pkg/infra/controllers/provision.go +++ b/client/pkg/infra/controllers/provision.go @@ -254,6 +254,8 @@ func (ctrl *ProvisionController[T]) reconcileRunning(ctx context.Context, r cont *machineRequestStatus.Metadata().Labels() = *machineRequest.Metadata().Labels() + logger.Info("machine provision finished") + return nil } diff --git a/frontend/src/views/omni/MachineClasses/MachineClass.vue b/frontend/src/views/omni/MachineClasses/MachineClass.vue index 384715b1..96bf020a 100644 --- a/frontend/src/views/omni/MachineClasses/MachineClass.vue +++ b/frontend/src/views/omni/MachineClasses/MachineClass.vue @@ -455,11 +455,11 @@ const submit = async () => { grpc_tunnel: grpcTunnelMode.value, } - if (kernelArguments.value) { + if (kernelArguments.value.length > 0) { machineClass.spec.auto_provision.kernel_args = kernelArguments.value.split(" "); } - if (initialLabels.value) { + if (initialLabels.value.length > 0) { const l: Record = {}; for (const k in initialLabels.value) { l[k] = initialLabels.value[k].value;