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

[JUJU-3614] Prevent panic on empty bundle contents #15535

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

SimonRichardson
Copy link
Member

@SimonRichardson SimonRichardson commented Apr 25, 2023

If the contents of a bundle is empty, then don't panic when attempting to read the contents.

The code expected that a validation check on the bundle contents was done before hand, but that's not always the case. This just guards against the scenario.

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Go unit tests, with comments saying what you're testing

QA steps

$ juju bootstrap lxd test --build-agent
$ touch bundle.yaml
$ juju deploy ./bundle.yaml

Bug reference

https://bugs.launchpad.net/juju/+bug/2017681

If the contents of a bundle is empty, then don't panic when attempting
to read the contents.

The code expected that a validation check on the bundle contents was
done before hand, but that's not always the case. This just guards
against the scenario.
@SimonRichardson SimonRichardson added bug The PR addresses a bug 3.2 labels Apr 25, 2023
@SimonRichardson SimonRichardson self-assigned this Apr 25, 2023
@jack-w-shaw
Copy link
Member

/merge

@jujubot jujubot merged commit 3a09870 into juju:3.2 Apr 26, 2023
@SimonRichardson SimonRichardson deleted the fix-empty-bundle-panic branch April 26, 2023 07:50
@barrettj12 barrettj12 mentioned this pull request May 9, 2023
jujubot added a commit that referenced this pull request May 9, 2023
@barrettj12 barrettj12 mentioned this pull request May 10, 2023
jujubot added a commit that referenced this pull request May 10, 2023
@anvial anvial mentioned this pull request Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The PR addresses a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants