-
Notifications
You must be signed in to change notification settings - Fork 18.9k
api: /info: omit non-distributable-artifacts fields for API >= 1.49 #49749
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
Conversation
273617c to
278d8ab
Compare
|
Needs a rebase |
|
Thx! Yes, was waiting for yours and Rob's PR's to be merged 😂 |
- registry.ServiceConfig: add a "ExtraFields" for outputting deprecated fields. - remove uses of AllowNondistributableArtifactsCIDRs and AllowNondistributableArtifactsHostnames Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
278d8ab to
7d9c50d
Compare
|
Rebased 👍 |
| // FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: | ||
| //go:build go1.22 |
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.
nit: Does the json.RawMessage(nil) need go1.22?
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.
No, but the any does require go .. whatever version added generics 😞
I was on the fence on changing it to interface{}, which would be the alternative
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.
I should probably add that this PR was slightly me exploring options for providing backward-compatibility fields, without that requiring keeping backward-compatibility types. Initially, I considered a map[string]json.RawMessage, but there are cases where that could not be super useful. The any still allows using a raw-message (for cases where, e.g. the deprecated type is no more, and we could just hard-code a placeholder response).
I was also considering if we could somehow set such legacy fields at the top-level struct (merging with nested fields), but that might get complicated fast, so not sure if that's a good approach.
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.
Ohh right, I missed the any 😄
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)