-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Parse term gws #10743
Parse term gws #10743
Conversation
adf9ff5
to
7b4e12b
Compare
Not sure what's going on with the failed checks, but it doesn't look like it's because of my changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@holtwilkins The HCL1 parser you're editing here will be going away once we're satisfied the HCL2 parser is fully correct. So generally speaking new features are only being parsed by the HCL2 parser. (And we verify that terminating gateways are being parsed with one of our E2E tests)
Going to ping @shoenig and @notnoop for their thoughts on this though.
Thanks @holtwilkins for contributing. I wanted to highlight that Nomad has switched to using Would love to hear the motivation of the change further. Would using the |
Unfortunately we're not quite ready to move to hcl2 for Nomad. We're in the process of migrating stacks, and will move fully to hcl2 once the migration is complete in a few months. I tried using jobspec2 for our jobs, but it throws lots of errors because of new paradigms required for escaping templates:
In the meantime, HCL1 supports terminating gateways, so it should be the case that the HCL1 job parser does as well, no? |
Also @notnoop & @tgross , the same error The fact that |
Very good points. Indeed, the new escaping change has been painful for our users, and we do intend to follow up with a disable interpolation option (e.g. heredoc syntax with We initially intended the hcl1 parser as a fallback to help users upgrade to 1.0.x but faced unexpected incompatibilities in hcl2 and don't want to change the job files yet. We reasoned that users that modify the job spec and take advantage of the new 1.X features can also resolve the incompatibilities. However, as you pointed out, it can be more painful that we like, and it makes sense to backport 1.0.X features back to HCL1 parser until we set better expectation and update the terraform provider.
That being said, I agree this is confusing and that the documentation is lacking. Nomad users should not need to know Nomad's parser internals to navigate their work. I'll discuss this PR and the terraform provider with the team and follow up. Thank you again for your the PR and for highlighting the problem! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great. I made a couple of suggestions and intend to the PR and follow up with other missed fields. Thank you so much!
Name: "service2", | ||
SNI: "myhost", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including the test and testing the nil ca_file cases.
a780275
to
02556d6
Compare
Hey @notnoop I think everything should be good now, if you could give another look. |
02556d6
to
898c6c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @holtwilkins for the PR again. This looks good - I'll inspect the other fields and update them too!
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Parse terminating gateway stanzas. While Nomad supports terminating GWs, its own parse function doesn't actually support them and populate the structs. This attempts to address that.