mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-20 23:07:33 +00:00
33 lines
585 B
Go
33 lines
585 B
Go
|
package provided
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/orbos/pkg/tree"
|
||
|
"github.com/pkg/errors"
|
||
|
)
|
||
|
|
||
|
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, errors.Wrap(err, "parsing desired state failed")
|
||
|
}
|
||
|
|
||
|
return desiredKind, nil
|
||
|
}
|