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

🌱 Add watch to in-memory server multiplexer #8851

Merged

Conversation

killianmuldoon
Copy link
Contributor

@killianmuldoon killianmuldoon commented Jun 13, 2023

Add watch to the CAPI in-memory provider's API server. This will allow the in-memory apiserver to deliver watch events when CAPI is watching resources like nodes on the workload cluster.

Part of #8814

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 13, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 13, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2023
@killianmuldoon killianmuldoon force-pushed the pr-in-memory-watch branch 2 times, most recently from a32a0c0 to dd89113 Compare June 13, 2023 18:28
@sbueringer sbueringer mentioned this pull request Jun 13, 2023
27 tasks
@killianmuldoon
Copy link
Contributor Author

/retitle 🌱 Add watch to in-memory server multiplexer

@k8s-ci-robot k8s-ci-robot changed the title [WIP] 🌱 Add watch to in-memory server multiplexer 🌱 Add watch to in-memory server multiplexer Jun 19, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2023
@killianmuldoon killianmuldoon force-pushed the pr-in-memory-watch branch 2 times, most recently from 62c4acd to e9cf72f Compare June 20, 2023 09:41
@killianmuldoon
Copy link
Contributor Author

/retest

test/infrastructure/inmemory/internal/server/listener.go Outdated Show resolved Hide resolved
test/infrastructure/inmemory/internal/server/mux_test.go Outdated Show resolved Hide resolved
test/infrastructure/inmemory/internal/server/mux_test.go Outdated Show resolved Hide resolved
test/infrastructure/inmemory/internal/server/api/watch.go Outdated Show resolved Hide resolved
test/infrastructure/inmemory/internal/server/api/watch.go Outdated Show resolved Hide resolved
test/infrastructure/inmemory/internal/server/api/watch.go Outdated Show resolved Hide resolved
Comment on lines 158 to 162
select {
case <-ctx.Done():
return
case <-timeoutTimer.C:
return
Copy link
Member

Choose a reason for hiding this comment

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

Q: Why do we need a context and a timer to timeout?

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'm not 100 percent on this - need to test it more. But this is what is done in the K8s APIServer. I haven't tested the timeouts on this properly - as they were being interfered with by the client timeout (and still are for our actual workload clusters). Would like to take it as a follow up though.

test/infrastructure/inmemory/internal/server/api/watch.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

Hm interesting. Unit tests failed, maybe because of the change in the deletion logic. (before the rebase unit tests of the in-memory provider were not run)

@killianmuldoon
Copy link
Contributor Author

Hm interesting. Unit tests failed, maybe because of the change in the deletion logic. (before the rebase unit tests of the in-memory provider were not run)

Yeah - mentioned here: #8851 (comment)

@killianmuldoon killianmuldoon force-pushed the pr-in-memory-watch branch 3 times, most recently from a019df8 to e79e813 Compare June 20, 2023 16:02
Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@sbueringer
Copy link
Member

/lgtm
/approve

Let's merge this. I think it's a huge step forward as it gives us functioning watches. Let's have a follow-up iteration for the smaller improvements suggested above

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d91153493ef4521e80e9734ae16f677ef9ba2005

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2023
@k8s-ci-robot k8s-ci-robot merged commit 3c9e154 into kubernetes-sigs:main Jun 21, 2023
10 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Jun 21, 2023
Copy link
Contributor Author

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/area provider/infrastructure-in-memory

@k8s-ci-robot k8s-ci-robot added the area/provider/infrastructure-in-memory Issues or PRs related to the in-memory infrastructure provider label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/infrastructure-in-memory Issues or PRs related to the in-memory infrastructure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants