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

resolver: Don't crash on nil objs #142

Merged
merged 1 commit into from
Aug 28, 2023
Merged

Conversation

DolceTriade
Copy link
Contributor

@DolceTriade DolceTriade commented Jul 24, 2023

If a YAML specifies an empty initContainers:, this will crash this code if we also specify yamls. regardless of how pointless this is, this is, it is valid k8s yaml that applies cleanly.

Related Issue

Fix #141

Motivation and Context

Fixes crash

How Has This Been Tested?

No longer crashes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@DolceTriade DolceTriade requested a review from a team as a code owner July 24, 2023 21:16
@michaelschiff
Copy link
Collaborator

Thanks for the contribution! Mind adding a test for this case?

If a YAML specifies an empty `initContainers:`, this will crash this
code if we also specify yamls. regardless of how pointless this is, this
is, it is valid k8s yaml that applies cleanly.
@DolceTriade
Copy link
Contributor Author

Sorry I missed your comment. Added a test case that crashes on main but not on my branch. PTAL, thanks!

@kzadorozhny kzadorozhny merged commit 5a9f3f7 into adobe:main Aug 28, 2023
3 of 4 checks passed
@DolceTriade DolceTriade deleted the resolvecrash branch August 29, 2023 00:43
arturo-skydio pushed a commit to Skydio/rules_gitops that referenced this pull request Oct 5, 2023
If a YAML specifies an empty `initContainers:`, this will crash this
code if we also specify yamls. regardless of how pointless this is, this
is, it is valid k8s yaml that applies cleanly.
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.

Crash if you specify an empty initContainer
3 participants