Skip to content

Commit

Permalink
fix: trim whitespace from VM UUID string prior to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Liaw committed Dec 31, 2024
1 parent 93ce169 commit 63dbf34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/url"
"os"
"os/signal"
"strings"
"sync"
"syscall"

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 63dbf34

Please sign in to comment.