gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

[public-api] Allow unknown fields in public-api-server config

Open andrew-farries opened this issue 3 years ago • 3 comments

Description

Allow unknown fields in the public-api-server config file.

Disallowing unknown fields guards against typos in the config file but makes it harder to deploy config changes independently of code changes. IMO the latter is worth more than the former.

Related Issue(s)

How to test

Release Notes

NONE

Documentation

Werft options:

  • [ ] /werft with-preview

andrew-farries avatar Aug 05 '22 07:08 andrew-farries

How can we have invalid config considering the installer reuses the same config struct that the public-api-server uses?

csweichel avatar Aug 05 '22 07:08 csweichel

How can we have invalid config considering the installer reuses the same config struct that the public-api-server uses?

It's not about installer vs comp, but gitpod-io/ops vs. gitpod-io/gitpod: Those are out-of-sync by nature. And not accounting for unknown fields can block rollbacks :x: .

@andrew-farries Can we make it so that "unknown field" triggers at least a warning? That's the same mode we have in installer, and I think it's a good trade-off between "broken config" and "backwards compatibility". :balance_scale:

geropl avatar Aug 05 '22 13:08 geropl

@andrew-farries Can we make it so that "unknown field" triggers at least a warning? That's the same mode we have in installer, and I think it's a good trade-off between "broken config" and "backwards compatibility".

That's a good idea. I'm not sure that Go's json decoder can do this 'out of the box' though - I'll have a look at how the installer does it.

andrew-farries avatar Aug 08 '22 05:08 andrew-farries

Going to move this back to draft given that I'm away from tomorrow and I haven't found an easy way to trigger warnings on unknown fields during unmarshalling yet.

andrew-farries avatar Aug 10 '22 11:08 andrew-farries

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 22:09 stale[bot]

closing as I don't have time to investigate this further.

andrew-farries avatar Sep 13 '22 14:09 andrew-farries