Skip to content

update tfk8s tests #64

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ljluestc
Copy link

This PR addresses the panic: value is null crash when processing the IstioOperator manifest (issue #62) by adding the stripNullFields function to remove null values from YAML manifests. It also fixes failing tests and adds validation for the IstioOperator case.

Changes:

  • Added stripNullFields function to recursively remove null fields when --strip-null is used.
  • Updated TestYAMLToHCLStripNull to use four-space indentation, matching terraform.FormatValue output.
  • Fixed TestYAMLToTerraformResourcesMapOnly to set mapOnly=true and updated expected HCL.
  • Added TestYAMLToHCLIstioOperatorStripNull to verify the IstioOperator manifest is processed correctly.
  • Ensured all tests pass with make test.

Testing:

  • Ran make test to confirm all tests pass.

@jrhouston
Copy link
Owner

Thanks for adding this @ljluestc I pushed a commit removing some redundant logic and adding an additional case to the test. I see you've left this in draft, was there something else you were going to add here? If not I'm happy to merge it.

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.

2 participants