mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-19 14:40:41 -04:00
cli: add field docs to the state file (#2453)
* add field docs to the state file * mark only optional fields * tidy * use talos encoder
This commit is contained in:
parent
afb154ceb7
commit
e5513f14e6
4 changed files with 319 additions and 45 deletions
|
@ -11,9 +11,9 @@ import (
|
|||
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
var defaultState = &State{
|
||||
|
@ -145,7 +145,7 @@ func TestReadFromFile(t *testing.T) {
|
|||
|
||||
func mustMarshalYaml(t *testing.T, v any) []byte {
|
||||
t.Helper()
|
||||
b, err := yaml.Marshal(v)
|
||||
b, err := encoder.NewEncoder(v).Encode()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to marshal yaml: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue