-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ServiceCreate/ServiceUpdate: refactor and fix potential NPE
- `ContainerSpec` and `PluginSpec` are mutually exclusive, so instead of using two separate if-statements, combine them in a switch. - Use local variables (at cost of some slight duplication) - Fix a potential NPE if image-digest resolution failed for a `PluginSpec`. The code was always using `ContainerSpec.Image` to create a `digestWarning`, but in case we're resoling the digest for a `PluginSpec`, `ContainerSpec` will be `nil` (as they're mutually exclusive). This issue was introduced in 72c3bcf, where the new `PluginSpec` path was added. Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
2 changed files
with
65 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters