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

kctrl: Helm array values with an empty default should still get an items field in their OpenAPI schema #1464

Closed
gcapizzi opened this issue Jan 25, 2024 · 0 comments · Fixed by #1465
Labels
bug This issue describes a defect or unexpected behavior

Comments

@gcapizzi
Copy link
Contributor

gcapizzi commented Jan 25, 2024

What steps did you take:

kctrl package release --openapi-schema of a package using a helmTemplate.

What happened:

Helm array values with an empty default, e.g.

# -- Add custom arguments to the Crossplane pod.
args: []

don't get an items field in OpenAPI:

args:
  default: []
  description: Add custom arguments to the Crossplane pod.
  type: array

What did you expect:

An items field, as it's required in OpenAPI:

args:
  default: []
  description: Add custom arguments to the Crossplane pod.
  type: array
  items: {}

Anything else you would like to add:

Using {} to provide an empty schema for items is valid and acceptable, as in this case we don't have any information about the type of the array items. This results in the array accepting arbitrary types.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@gcapizzi gcapizzi added bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Jan 25, 2024
@gcapizzi gcapizzi changed the title kctrl: Helm array values should get an items field in their OpenAPI schema kctrl: Helm array values with an empty default should still get an items field in their OpenAPI schema Jan 25, 2024
gcapizzi added a commit to gcapizzi/kapp-controller that referenced this issue Jan 25, 2024
The `items` field in OpenAPI schema is required, this makes sure that we
always add it, even if the default value is an empty array.

Fixes carvel-dev#1464.
gcapizzi added a commit to gcapizzi/kapp-controller that referenced this issue Jan 25, 2024
The `items` field in OpenAPI schema is required, this makes sure that we
always add it, even if the default value is an empty array.

Fixes carvel-dev#1464.

Signed-off-by: Giuseppe Capizzi <[email protected]>
@github-actions github-actions bot removed the carvel-triage This issue has not yet been reviewed for validity label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant