Skip to content

Commit

Permalink
correctly identify defaulted values fields in AppInstalls (#13171)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Bein <simontheleg@gmail.com>
  • Loading branch information
SimonTheLeg committed Mar 12, 2024
1 parent 982bc2a commit 1ae8945
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/apps.kubermatic/v1/application_installation.go
Expand Up @@ -294,7 +294,7 @@ func (ai *ApplicationInstallationSpec) GetParsedValues() (map[string]interface{}
if len(ai.Values.Raw) > 0 && string(ai.Values.Raw) != "{}" && ai.ValuesBlock != "" {
return nil, fmt.Errorf("the fields Values and ValuesBlock cannot be used simultaneously. Please delete one of them.")
}
if len(ai.Values.Raw) > 0 {
if len(ai.Values.Raw) > 0 && string(ai.Values.Raw) != "{}" {
err := json.Unmarshal(ai.Values.Raw, &values)
return values, err
}
Expand Down
Expand Up @@ -46,7 +46,7 @@ func TestGetParsedValues(t *testing.T) {
},
"ValuesBlock set and Values Defaulted": {
appIn: ApplicationInstallationSpec{
Values: runtime.RawExtension{},
Values: runtime.RawExtension{Raw: []byte("{}")},
ValuesBlock: "not-empty:\n value",
},
expResponse: map[string]interface{}{"not-empty": "value"},
Expand Down

0 comments on commit 1ae8945

Please sign in to comment.