package provided import ( "fmt" "github.com/caos/orbos/mntr" "github.com/caos/orbos/pkg/tree" ) type DesiredV0 struct { Common *tree.Common `yaml:",inline"` Spec Spec } type Spec struct { Verbose bool Namespace string URL string Port string Users []string } func parseDesiredV0(desiredTree *tree.Tree) (*DesiredV0, error) { desiredKind := &DesiredV0{ Common: desiredTree.Common, Spec: Spec{}, } if err := desiredTree.Original.Decode(desiredKind); err != nil { return nil, mntr.ToUserError(fmt.Errorf("parsing desired state failed: %w", err)) } return desiredKind, nil }