Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Api latency #58

Merged
merged 6 commits into from
Apr 24, 2018
Merged

Api latency #58

merged 6 commits into from
Apr 24, 2018

Conversation

stevesloka
Copy link
Member

Fixes #47

Signed-off-by: Steve Sloka <steves@heptio.com>
Signed-off-by: Steve Sloka <steves@heptio.com>
@stevesloka stevesloka requested a review from alexbrand April 24, 2018 19:00
@@ -123,13 +124,16 @@ func main() {
osClient.HTTPClient.Transport = httpTransportWithCA(log, openstackCertificateAuthorityFile)
}

osClient.HTTPClient = newHTTPClient()
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this will break the ability to provide a CA cert for use in the HTTP transport (L123). We should also make sure to respect the timeout passed via flag and set in L121.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me double check

Signed-off-by: Steve Sloka <steves@heptio.com>
Signed-off-by: Steve Sloka <steves@heptio.com>
Signed-off-by: Steve Sloka <steves@heptio.com>
@stevesloka
Copy link
Member Author

@alexbrand I refactored the http client and also moved the clusterType to main since now we're referencing in a few places.

if openstackCertificateAuthorityFile != "" {
osClient.HTTPClient.Transport = httpTransportWithCA(log, openstackCertificateAuthorityFile)
dClient.Transport = httpTransportWithCA(log, openstackCertificateAuthorityFile)
Copy link
Contributor

Choose a reason for hiding this comment

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

We will overwrite the openstack.LogRoundTripper that we are configuring in L126.

I think something like this would work?

transport := &openstack.LogRoundTripper{
			RoundTripper: http.DefaultTransport,
			Log:          log,
			ClusterName:  clusterName,
			ClusterType:  clusterType,
			Metrics:      &discovererMetrics,
}
if openstackCertificateAuthorityFile != "" {
  transport.RoundTripper = httpTransportWithCA(log, openstackCertificateAuthorityFile)
}

osClient.HTTPClient = http.Client{
  Transport: transport,
  Timeout: httpClientTimeout,
}

Signed-off-by: Steve Sloka <steves@heptio.com>
Copy link
Contributor

@alexbrand alexbrand left a comment

Choose a reason for hiding this comment

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

LGTM

@alexbrand alexbrand merged commit 2a75718 into projectcontour:master Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants