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

[v0.11] cmd: Introduce HUBBLE_COMPAT=legacy-json-output #866

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

gandro
Copy link
Member

@gandro gandro commented Jan 24, 2023

[ upstream commit 221b8ea ]

This commit introduces a new environment variable, HUBBLE_COMPAT, which can be used to restore old behavior in the presence of breaking changes. It's inspired by Golang's GODEBUG variable documented here: https://pkg.go.dev/runtime

The intent of this flag is to allow us introduce breaking changes in the CLI, while still preserving backwards-compatibility with older versions where needed. As an example, this commit also bring back the legacy -o json flow schema if HUBBLE_COMPAT is set to legacy-json-output. This allows older Cilium stable versions to pull in a newer version of the Hubble CLI as part of security updates, while preserving the behavior of the Hubble CLI that originally shipped with that Cilium version.

HUBBLE_COMPAT options are not intended to be supported indefinitely. Rather, compat options may be removed once the ecosystem (such as downstream users like the Cilium-Agent image) has caught up.

We use an environment variable instead of a viper flag to ensure that we could also use it to modify the behavior of viper or pflags if needed in the future.

Signed-off-by: Sebastian Wicki sebastian@isovalent.com

[ upstream commit 221b8ea ]

This commit introduces a new environment variable, `HUBBLE_COMPAT`,
which can be used to restore old behavior in the presence of breaking
changes. It's inspired by Golang's GODEBUG variable documented here:
https://pkg.go.dev/runtime

The intent of this flag is to allow us introduce breaking changes in the
CLI, while still preserving backwards-compatibility with older versions
where needed. As an example, this commit also bring back the legacy `-o
json` flow schema if `HUBBLE_COMPAT` is set to `legacy-json-output`.
This allows older Cilium stable versions to pull in a newer version of
the Hubble CLI as part of security updates, while preserving the
behavior of the Hubble CLI that originally shipped with that Cilium
version.

HUBBLE_COMPAT options are _not_ intended to be supported indefinitely.
Rather, compat options may be removed once the ecosystem (such as
downstream users like the Cilium-Agent image) has caught up.

We use an environment variable instead of a viper flag to ensure that we
could also use it to modify the behavior of viper or pflags if needed in
the future.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro added the backport/0.11 This PR is a backport for Hubble v0.11 label Jan 24, 2023
@gandro gandro requested a review from a team as a code owner January 24, 2023 16:49
@gandro gandro requested review from chancez and removed request for a team January 24, 2023 16:49
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label PR is blocked until the release note is set label Jan 24, 2023
@gandro gandro added the release-note/minor This PR introduces functionality that users may find relevant to operating Hubble. label Jan 24, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label PR is blocked until the release note is set label Jan 24, 2023
@gandro gandro requested a review from rolinh January 24, 2023 16:49
@gandro gandro changed the title cmd: Introduce HUBBLE_COMPAT=legacy-json-output [v0.11] cmd: Introduce HUBBLE_COMPAT=legacy-json-output Jan 24, 2023
@gandro gandro merged commit 70fb65a into v0.11 Jan 24, 2023
@gandro gandro deleted the pr/gandro/backport-hubble-compat branch January 24, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/0.11 This PR is a backport for Hubble v0.11 release-note/minor This PR introduces functionality that users may find relevant to operating Hubble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants