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

Can't correlate report entries for zero-valued structs when producing MachineConfigs #213

Open
bgilbert opened this issue Mar 19, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@bgilbert
Copy link
Contributor

This config has an invalid Filesystem object that parses into a zero-valued struct:

variant: openshift
version: 4.8.0-experimental
metadata:
  name: z
storage:
  filesystems:
    - z: q

When transpiling with --raw FCCT produces the correct line/column information:

warning at $.storage.filesystems.0.z, line 7 col 7: Unused key z
error at $.storage.filesystems.0.device, line 7 col 7: path not specified
Error translating config: config generated was invalid

But when transpiling to a MachineConfig it does not:

warning at $.storage.filesystems.0.z, line 7 col 7: Unused key z
error at $.spec.config.storage.filesystems.0.device, line 1 col 1: path not specified
Error translating config: config generated was invalid

The reason is that both the Ignition merge transcript and the FCCT TranslationSet omit translation info for zero-valued structs, to keep the translation compact (for debugging and test case writing; this doesn't affect normal use). When we're producing an Ignition config and thus not reparenting the output struct, translateReportPaths() falls back to leaving the input path unchanged, that path exists in the TranslationSet, and Correlate() is able to set the report entry marker correctly. But when we're producing a MachineConfig, the report entry path doesn't exist in the TranslationSet, and the nearest available ancestor of the bad line is the root of the input struct at line 1, column 1.

@bgilbert bgilbert added the bug Something isn't working label Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant