adobe / rules_gitops

This repository contains rules for continuous, GitOps driven Kubernetes deployments.
Apache License 2.0
174 stars 43 forks source link

resolver: Don't crash on nil objs #142

Closed DolceTriade closed 1 year ago

DolceTriade commented 1 year ago

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

Checklist:

michaelschiff commented 1 year ago

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

DolceTriade commented 1 year ago

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