Skip to content

Logic for generating LDS v2 response#4049

Merged
costinm merged 3 commits intoistio:masterfrom
ostromart:lds_v2_logic
Mar 9, 2018
Merged

Logic for generating LDS v2 response#4049
costinm merged 3 commits intoistio:masterfrom
ostromart:lds_v2_logic

Conversation

@ostromart
Copy link
Copy Markdown
Contributor

This is a heavily refactored version of ostromart#8, due to lots of changes in the protos since the start of that PR.
Many of the functions are based on the v1 versions. For easy review, patch the PR and locally diff the v2 version against the v1 version e.g. meld v1/fault.go v2/fault.go. This will reveal the changes that were needed to build the v2 versions.

@ostromart ostromart requested a review from a team March 7, 2018 18:52
@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
We suggest the following additional approver: costinm

Assign the PR to them by writing /assign @costinm in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@kyessenov
Copy link
Copy Markdown
Contributor

Is this for v1alpha1 or v1alpha3 or both?

@ostromart
Copy link
Copy Markdown
Contributor Author

It depends on both alpha1 and alpha3 APIs so I guess that means it must be for alpha3 only.

@ostromart
Copy link
Copy Markdown
Contributor Author

/retest

@ostromart ostromart force-pushed the lds_v2_logic branch 3 times, most recently from 7bea6b8 to 7b8f6e5 Compare March 8, 2018 19:02
@ostromart ostromart requested a review from a team March 8, 2018 19:02
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2018

Codecov Report

Merging #4049 into master will decrease coverage by 2%.
The diff coverage is 1%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #4049    +/-   ##
=======================================
- Coverage      75%     74%    -1%     
=======================================
  Files         305     313     +8     
  Lines       27845   28126   +281     
=======================================
- Hits        20852   20532   -320     
- Misses       5664    6337   +673     
+ Partials     1329    1257    -72
Impacted Files Coverage Δ
pilot/pkg/config/kube/crd/client.go 69% <ø> (ø) ⬆️
pilot/pkg/proxy/envoy/v2/config.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/header.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/ingress.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/externalservice.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/gateway.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/util.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/fault.go 0% <0%> (ø)
pilot/pkg/proxy/envoy/v2/lds.go 0% <0%> (ø)
pilot/pkg/bootstrap/server.go 42% <100%> (ø) ⬆️
... and 36 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 b8229fc...ebc66ef. Read the comment docs.

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Mar 8, 2018

The goal is alpha1 and alpha3 - but we can relax it if needed.

Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

Looks like most of this is a copy of v1, with conversions to the new protos.

Thanks for breaking this into smaller PRs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it have to be exported ? Same for other methods/etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is it used ? Add a TODO to use a map, iterating is not good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's used in a few places when building protos. I assume you mean to pass the map around (building it inside we still have to iterate). So that would complicate the code a little since we'd have to sync the map with the slice whenever that changes to avoid rebuilding every time. I've put a comment through.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For this and other similar - did you use an automated tool ? Better to keep cosmetic changes separate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used goimports. It was because make lint was complaining about it. It is better not to change and commit with the lint warnings?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In a separate iteration, I suggest a bit of cleanup - no need to return clusters for example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, absolutely. This is just a minimum viable product, there are many places it can be trimmed and improved. I wanted to keep the changes minimal to focus on correctness initially.

@istio-testing
Copy link
Copy Markdown
Collaborator

istio-testing commented Mar 9, 2018

@ostromart: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/e2e-simpleTests.sh ebc66ef link /test e2e-simple
prow/e2e-bookInfoTests.sh ebc66ef link /test e2e-bookInfo
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Mar 9, 2018

One suggestion for a follow-up PR: please move all ingress related logic to an lds_ingress.go file.
Ingress has 2 listeners in v1 - so it's much easier to test and understand. In alpha3 it may get additional
data from Gateways - but we are mostly interested in generating the SNI certs.

Decoupling ingress will both simplify testing and unblock SNI testing, and simplify the in-mesh logic
since it won't need to deal with the ingress logic.

@costinm costinm merged commit a470a6e into istio:master Mar 9, 2018
@ostromart ostromart deleted the lds_v2_logic branch March 9, 2018 21:49
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.

6 participants