-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
destination: Remove support for IP Queries in Get
API
#6018
Conversation
Fixes #5246 This PR updates the destination to report an error when `Get` is called for IP Queries. As the issue mentions, The proxies are not using this API anymore and it helps to simplify and remove unecessary logic. This change is aimed for `stable-2.11`, and depends on linkerd/linkerd2-proxy#972 Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
as `Get` no longer returns pod IP queries, We don't have to maintain the logic for subscriptions. Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
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.
So the IP watcher is used for GetSvcID
and GetPod
now. However, both of those functions only use the k8sAPI
field which we have access to in the server. We should change those from methods on IPWatcher
to methods on Server
.
NewIPWatcher
has a side effect which adds the podIPIndex
and hostIPIndex
indexers to the k8sAPI
that is passed in. Adding those indexers should probably move to Server
's initialization. After doing that, I think we should be able to fully get rid of IPWatcher
.
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
This commit moves the indexer creations into Server.go, so that there is a single place where all indexers are created instead of each watcher doing its own. This works because the same `k8s.API` is used across watchers and the server. With this change, The golang watcher tests are expected to fail as the informers are outside of the watcher logic that they test. Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
… tests This commit updates the unit tests to call `initializeIndexers` to initialize indexers before running the watcher specific unit tests. The `initializeIndexers` had to be in `k8s.go` in `watcher` pkg as it had to be used across watcher and the destination pkg. Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
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.
Overall this looks good. I think moving the watcher setup into a function makes sense so that it's more obvious that we are adding indexers as part of its initialization.
I was going to suggest making getSvcID
and getPod
as methods on Server
, but since we don't use any other fields from the server I think they are okay as regular functions. That being said, it may be worth making them methods on k8s.API
in the controller
package. That way we can keep functions like this in a singular place.
Old:
svcID, err := getSvcID(s.k8sAPI, ip.String(), log)
New:
svcID, err := s.k8sAPI.getSvcID(ip.String(), log)
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.
👑 💇
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
I'm not sure if it is the right way to do it for the following reasons:
How about we keep this logic in the same pkg but into a different file, so that |
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.
I'm okay with it is as is then. I don't think introducing a new file will necessarily make it easier to read or understand. It'd be nice if we had a way to track these functions that are based off having a k8sAPI
—and making them methods does seem ideal—but if it brings in a lot of extra dependencies and all then I also don't think that's the right solution.
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Fixes #5246
This PR updates the destination to report an error when
Get
is called for IP Queries. As the issue mentions, The proxies
are not using this API anymore and it helps to simplify and
remove unecessary logic.
This change is aimed for
stable-2.11
, and depends onlinkerd/linkerd2-proxy#972
Signed-off-by: Tarun Pothulapati tarunpothulapati@outlook.com