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

chore(*) delete CLI flag '--bootstrap-version' #2965

Merged
merged 5 commits into from
Oct 21, 2021

Conversation

lobkovilya
Copy link
Contributor

Summary

Based on envoyproxy/envoy#16456, since v4 is very far away we decided to delete a bootstrap version field from Kuma.

Full changelog

  • delete from kuma-dp flags
  • delete from BootstrapRequest
  • delete from kuma-cp config

Issues resolved

N/A

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • Add backport-to-stable label if the code is backwards compatible. Otherwise, list breaking changes.

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2021

Codecov Report

Merging #2965 (0584249) into master (c586219) will increase coverage by 0.01%.
The diff coverage is 61.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2965      +/-   ##
==========================================
+ Coverage   52.37%   52.39%   +0.01%     
==========================================
  Files         912      912              
  Lines       52522    52493      -29     
==========================================
- Hits        27510    27502       -8     
+ Misses      22817    22798      -19     
+ Partials     2195     2193       -2     
Impacted Files Coverage Δ
pkg/config/app/kuma-dp/config.go 63.15% <ø> (ø)
...pp/kuma-dp/pkg/dataplane/envoy/remote_bootstrap.go 60.95% <40.00%> (-0.37%) ⬇️
pkg/xds/bootstrap/generator.go 62.94% <63.63%> (-0.88%) ⬇️
pkg/xds/bootstrap/handler.go 41.81% <66.66%> (ø)
app/kuma-dp/cmd/run.go 71.14% <100.00%> (+0.39%) ⬆️
app/kuma-dp/pkg/dataplane/envoy/envoy.go 79.82% <100.00%> (-0.52%) ⬇️
pkg/config/xds/bootstrap/config.go 56.25% <100.00%> (-0.51%) ⬇️
pkg/core/resources/manager/cache.go 83.11% <0.00%> (-5.20%) ⬇️
api/observability/v1/mads.pb.go 35.56% <0.00%> (+1.03%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c586219...0584249. Read the comment docs.

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@lobkovilya lobkovilya mentioned this pull request Oct 18, 2021
6 tasks
@@ -226,7 +226,8 @@ func newRunCmd(opts kuma_cmd.RunCmdOpts, rootCtx *RootContext) *cobra.Command {
cmd.PersistentFlags().StringVar(&cfg.ControlPlane.CaCertFile, "ca-cert-file", cfg.ControlPlane.CaCertFile, "Path to CA cert by which connection to the Control Plane will be verified if HTTPS is used")
cmd.PersistentFlags().StringVar(&cfg.DataplaneRuntime.BinaryPath, "binary-path", cfg.DataplaneRuntime.BinaryPath, "Binary path of Envoy executable")
cmd.PersistentFlags().Uint32Var(&cfg.DataplaneRuntime.Concurrency, "concurrency", cfg.DataplaneRuntime.Concurrency, "Number of Envoy worker threads")
cmd.PersistentFlags().StringVar(&cfg.Dataplane.BootstrapVersion, "bootstrap-version", cfg.Dataplane.BootstrapVersion, "Bootstrap version (and API version) of xDS config. If empty, default version defined in Kuma CP will be used. (ex. '2', '3')")
cmd.PersistentFlags().StringVar(&bootstrapVersion, "bootstrap-version", "", "Bootstrap version (and API version) of xDS config. If empty, default version defined in Kuma CP will be used. (ex. '2', '3')")
_ = cmd.PersistentFlags().MarkDeprecated("bootstrap-version", "Envoy API v3 is used by default")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message makes it seem like it still does something IMO since a deprecated command could just be discouraged. I think changing "by default" to "and can not be changed. This flag is not respected." or something similar would help. Might even be worth throwing an error if it's used?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend against throwing an error, since that would immediately break existing deployments that use the flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we can't throw an error here. Updated the message, now it looks like:

Flag --bootstrap-version has been deprecated, Envoy API v3 is used and can not be changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah indeed, although if somebody uses the flag and sets something different from the default, just ignoring it may not be much better since presumably something will break for them that's even harder to diagnose. In the end a proper deprecate -> remove process would be best but I think there wasn't really time here.

return nil
}

func DefaultBootstrapServerConfig() *BootstrapServerConfig {
return &BootstrapServerConfig{
APIVersion: envoy_common.APIV3,
Params: DefaultBootstrapParamsConfig(),
//APIVersion: envoy_common.APIV3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better just to leave this out, otherwise it might get out of sync one day.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that was unintentionally, thanks!

DNSPort uint32 `json:"dnsPort,omitempty"`
EmptyDNSPort uint32 `json:"emptyDnsPort,omitempty"`
DNSPort uint32 `json:"dnsPort,omitempty"`
EmptyDNSPort uint32 `json:"emptyDnsPort,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is a compatible change. If the DP is upgraded before the CP is, then the CP would not receive the BootstrapVersion field when it unmarshals the request JSON. That would be OK, but the field would be empty, so in the bootstrap generator the check in (*bootstrapGenerator)configForParameters() would fail and the DP would not be able to bootstrap.

To get across the upgrade, it would be safer for the DP to always send this field with a fixed value, then we can ignore it on the CP side and remove the DP code in a later release.

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. We should file an issue to follow up and remove remnants of the bootstrap in a future release (and we can ref the issue number from the TODO comments).

@lobkovilya Did you manually confirm that this works with a Envoy 1.18 DP?

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@lobkovilya
Copy link
Contributor Author

@jpeach done #2986

@lobkovilya lobkovilya merged commit 85b4c67 into master Oct 21, 2021
@lobkovilya lobkovilya deleted the chore/delete-bootstrap-version branch October 21, 2021 15:25
lobkovilya added a commit that referenced this pull request Oct 21, 2021
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
(cherry picked from commit 85b4c67)

Co-authored-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants