Skip to content

Commit

Permalink
fix case of stringData yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bookshelfdave committed Nov 15, 2018
1 parent 41c9a3b commit 1e8963d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ksv.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type v1secret struct {
Metadata map[string]interface{}
Type string
Data map[string]string
StringData map[string]string
StringData map[string]string `yaml:"stringData"`
}

func readInputOrFail(r io.Reader) []byte {
Expand Down
7 changes: 7 additions & 0 deletions ksv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ func TestDecodeToStringData(t *testing.T) {
if s.StringData["password"] != "1f2d1e2e67df" {
t.Error("Invalid password value")
}
secretYaml, err := secretToYamlString(s)
if err != nil {
t.Error("Error converting secret to yaml")
}
if !strings.Contains(secretYaml, "stringData") {
t.Error("Doesn't contain the stringData key")
}
}

func TestAdd(t *testing.T) {
Expand Down

0 comments on commit 1e8963d

Please sign in to comment.