Skip to content

Return empty slice from ListInstallations#3339

Merged
kichristensen merged 2 commits intogetporter:mainfrom
erikced:fix-installations-json-output
Mar 15, 2025
Merged

Return empty slice from ListInstallations#3339
kichristensen merged 2 commits intogetporter:mainfrom
erikced:fix-installations-json-output

Conversation

@erikced
Copy link
Copy Markdown
Contributor

@erikced erikced commented Feb 20, 2025

What does this change

Return an empty slice instead of a nil slice if there are no matching installations, so that the json marshaler returns [] instead of null.

What issue does it fix

Closes #3338

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Return an empty slice instead of a `nil` slice if there are no matching
installations, so that the json marshaler returns `[]` instead of
`null` when outputting json.

Signed-off-by: Erik Cederberg <erik.cederberg@sectra.com>
Signed-off-by: Erik Cederberg <erik.cederberg@sectra.com>
@erikced erikced changed the title Fix installations json output Return empty slice from ListInstallations Feb 20, 2025
@kichristensen kichristensen merged commit 38c00f6 into getporter:main Mar 15, 2025
@erikced erikced deleted the fix-installations-json-output branch April 27, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Porter returns null when listing installations

3 participants