From 63dbf341c45a0b9a88470e2c804f601390d60473 Mon Sep 17 00:00:00 2001 From: Clement Liaw Date: Tue, 31 Dec 2024 12:57:47 -0800 Subject: [PATCH] fix: trim whitespace from VM UUID string prior to use --- internal/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/server.go b/internal/server.go index a3f99d2..76021ff 100644 --- a/internal/server.go +++ b/internal/server.go @@ -9,6 +9,7 @@ import ( "net/url" "os" "os/signal" + "strings" "sync" "syscall" @@ -92,7 +93,7 @@ func getHostInstance(ctx context.Context) (*crusoeapi.InstanceV1Alpha5, error) { return nil, fmt.Errorf("%w: %w", errVMIDReadFailed, err) } - vmIDString := string(vmIDStringByteArray) + vmIDString := strings.TrimSpace(string(vmIDStringByteArray)) _, err = uuid.Parse(vmIDString) if err != nil { return nil, fmt.Errorf("%w: %w", errVMIDParseFailed, err)