Skip to content

Commit

Permalink
Add JSON formatting check to the add-ign function
Browse files Browse the repository at this point in the history
  • Loading branch information
skyblaster authored Dec 14, 2024
1 parent 24e21b4 commit 25bb571
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/kvpctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package main

import (
"bytes"
"encoding/json"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -225,6 +226,10 @@ func addIgnFile(vm *hypervctl.VirtualMachine, inputFilename string) error {
if err != nil {
return err
}
var js json.RawMessage
if err := json.Unmarshal(b, &js); err != nil {
return fmt.Errorf("invalid JSON format: %v", err)
}
parts, err := ginsu.Dice(bytes.NewReader(b))
if err != nil {
return err
Expand Down

0 comments on commit 25bb571

Please sign in to comment.