Skip to content

IstioOperator Manifest Causes Crash#64

Open
ljluestc wants to merge 4 commits into
jrhouston:mainfrom
ljluestc:fix-istiooperator-crash
Open

IstioOperator Manifest Causes Crash#64
ljluestc wants to merge 4 commits into
jrhouston:mainfrom
ljluestc:fix-istiooperator-crash

Conversation

@ljluestc

Copy link
Copy Markdown

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
Copy Markdown
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.

- Fixed null metadata handling in yamlToHCL function to prevent panic when processing IstioOperator manifests without metadata
- Updated TestYAMLToTerraformResourcesMapOnly to properly test mapOnly=true functionality
- Added TestYAMLToHCLIstioOperatorStripNull test to verify IstioOperator manifest processing
- All tests now pass including race condition checks
- Resolves issue jrhouston#62: IstioOperator Manifest Causes Crash
- Restored comment for ignoreMetadata variable
- Restored comment for ignoreAnnotations variable
- Restored inline comments for empty document handling
- Restored original flag descriptions
- All tests still pass after comment restoration
@ljluestc ljluestc marked this pull request as ready for review October 12, 2025 20:59
@ljluestc ljluestc requested a review from jrhouston as a code owner October 12, 2025 20:59
@ljluestc ljluestc changed the title update tfk8s tests IstioOperator Manifest Causes Crash Oct 12, 2025
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