diff --git a/cmd/incus-agent/config.go b/cmd/incus-agent/config.go index b98b129827..5d68475d13 100644 --- a/cmd/incus-agent/config.go +++ b/cmd/incus-agent/config.go @@ -5,7 +5,7 @@ import ( "io/fs" "os" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v4" ) type agentConfig struct { @@ -23,7 +23,7 @@ func loadAgentConfig(d *Daemon) error { } cfg := agentConfig{} - err = yaml.Unmarshal(data, &cfg) + err = yaml.Load(data, &cfg) if err != nil { return err } diff --git a/cmd/incus-agent/templates.go b/cmd/incus-agent/templates.go index 2b71a0addf..fc1b00a20c 100644 --- a/cmd/incus-agent/templates.go +++ b/cmd/incus-agent/templates.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strconv" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v4" "github.com/lxc/incus/v6/shared/api" "github.com/lxc/incus/v6/shared/util" @@ -27,7 +27,7 @@ func templatesApply(path string) ([]string, error) { } metadata := &api.ImageMetadata{} - err = yaml.Unmarshal(content, metadata) + err = yaml.Load(content, metadata) if err != nil { return nil, fmt.Errorf("Could not parse metadata.yaml: %w", err) }