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

fix(clouddriver): NPE applying empty artifact manifest #5645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sepulvedablanco
Copy link

@sepulvedablanco sepulvedablanco commented Mar 1, 2022

When a Deploy (Manifest) step is executed configuring an artifact without content, a java.lang.NullPointerException is thrown, which is displayed in Deck and the step fails as can be seen in the following screenshot:

image

@spinnakerbot
Copy link
Contributor

The following commits need their title changed:

  • 6e2bba6: Fix NPE while applying empty manifest

Please format your commit title into the form:

<type>(<scope>): <subject>, e.g. fix(kubernetes): address NPE in status check

This allows us to easily generate changelogs & determine semantic version numbers when cutting releases. You can read more about commit conventions here.

Copy link
Contributor

@german-muzquiz german-muzquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!
Can you add a unit test validating that the issue that you were seeing is fixed? I assume that's by supplying a description with null values for both getManifests and getManifest. Also we need a test that uses the singular version because now all of them use only the plural version.

@SuppressWarnings("deprecation")
KubernetesManifest manifest = description.getManifest();

if (CollectionUtils.isEmpty(inputManifests) && manifest != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both description.getManifests() and description.getManifest() return null, there will be a new NullPointerException in line 186, so we need to make sure that inputManifests is never null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants