diff --git a/shared/subprocess/manager.go b/shared/subprocess/manager.go index 7a356d0d44..9d4120ec98 100644 --- a/shared/subprocess/manager.go +++ b/shared/subprocess/manager.go @@ -7,7 +7,7 @@ import ( "io" "os" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v4" ) // NewProcess is a constructor for a process object. Represents a process with argument config. @@ -58,7 +58,7 @@ func ImportProcess(path string) (*Process, error) { } proc := Process{} - err = yaml.Unmarshal(dat, &proc) + err = yaml.Load(dat, &proc) if err != nil { return nil, fmt.Errorf("Unable to parse YAML in PID file %q: %w", path, err) } diff --git a/shared/subprocess/proc.go b/shared/subprocess/proc.go index 947eef1662..e4ffb2176d 100644 --- a/shared/subprocess/proc.go +++ b/shared/subprocess/proc.go @@ -11,7 +11,7 @@ import ( "os/exec" "syscall" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v4" "github.com/lxc/incus/v6/shared/util" ) @@ -269,7 +269,7 @@ func (p *Process) Reload() error { // Save will save the given process object to a YAML file. Can be imported at a later point. func (p *Process) Save(path string) error { - dat, err := yaml.Marshal(p) + dat, err := yaml.Dump(p, yaml.V2) if err != nil { return fmt.Errorf("Unable to serialize process struct to YAML: %w", err) }