-
Notifications
You must be signed in to change notification settings - Fork 10
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
NET-10480 - fix setting namespace and partition setting in dns-proxy mode #593
Conversation
@@ -27,9 +27,8 @@ const ( | |||
) | |||
|
|||
// bootstrapConfig generates the Envoy bootstrap config in JSON format. | |||
func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) (*bootstrap.BootstrapConfig, []byte, error) { | |||
func (cdp *ConsulDataplane) getBootstrapParams(ctx context.Context) (*pbdataplane.GetEnvoyBootstrapParamsResponse, error) { |
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.
dns proxy requires bootstrap params to set the namespace and partition.....but it does not require the bootstrap config itself. So we are splitting this into two functions, so that startDNSProxy()
can get require bootstrap params in its signature rather than just assuming it is already set on the struct.
|
||
// bootstrapConfig generates the Envoy bootstrap config in JSON format. | ||
func (cdp *ConsulDataplane) bootstrapConfig( | ||
bootstrapParams *pbdataplane.GetEnvoyBootstrapParamsResponse) (*bootstrap.BootstrapConfig, []byte, error) { |
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.
A prior call will already have gotten bootstrap params for this call as well as startDNSProxy()
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 refactoring this and adding test + log cover 👍🏻
This fixes how namespace and partition get set when in dns-proxy mode. The prior attempt at this moved starting the DNS above starting envoy. What was not clear was that starting envoy set
resolvedProxyConfig
in state so it was not set when DNS started and dns-proxy always started with the default namespace and partition. In the process, i also got rid of using state to pass parameters and just used the function signature to have the appropriate parameters.