Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use a string as the OpenAPI default value for Helm values with an empty object default #1449

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (h HelmValuesSchemaGen) calculateProperties(key *yaml3.Node, value *yaml3.N
if len(properties) > 0 {
apiKeys = append(apiKeys, &MapItem{Key: propertiesKey, Value: &Map{Items: properties}})
} else {
apiKeys = append(apiKeys, &MapItem{Key: defaultKey, Value: "{}"})
apiKeys = append(apiKeys, &MapItem{Key: defaultKey, Value: &Map{}})
}
case yaml3.SequenceNode:
apiKeys = append(apiKeys, &MapItem{Key: typeKey, Value: arrayVal})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ arrExample:
floatExample: 2.3
# Integer example
intExample: 3
# Object example
objExample: {}
`,
want: `properties:
arrExample:
Expand Down Expand Up @@ -111,6 +113,10 @@ intExample: 3
default: test-container
description: Container name
type: string
objExample:
default: {}
description: Object example
type: object
type: object
`},
{
Expand Down
8 changes: 4 additions & 4 deletions cli/test/e2e/package_authoring_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ spec:
operator:
properties:
affinity:
default: '{}'
default: {}
type: object
createOperatorServiceAccount:
default: true
Expand All @@ -281,7 +281,7 @@ spec:
objects like Deployment, ServiceAccount, Role etc.
type: string
nodeSelector:
default: '{}'
default: {}
type: object
operator_image_name:
default: mongodb-enterprise-operator
Expand Down Expand Up @@ -817,7 +817,7 @@ spec:
default: ""
type: string
podAnnotations:
default: '{}'
default: {}
type: object
replicaCount:
default: 1
Expand All @@ -834,7 +834,7 @@ spec:
serviceAccount:
properties:
annotations:
default: '{}'
default: {}
description: Annotations to add to the service account
type: object
create:
Expand Down
Loading