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

feat: add v2 pod controller w/ workload lifecycle #2868

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

DanStough
Copy link
Contributor

@DanStough DanStough commented Aug 30, 2023

This PR is part of a series of PRs that add functionality to the V2 Pod Controller. For the MVP task to be complete, there will be one additional PR to fill in the lifecycle of HealthStatus and ProxyConfiguration resources.

TODO(dans) comments are needed for the MVP tasks. Other TODOs are captured in future stories.

Changes proposed in this PR:

  • Add the V2 Pod Controller
  • Add enough logic in the controller to manage Consul Workloads
  • pod controller test framework, borrowed from the endpoints controller.

How I've tested this PR: Unit tests

How I expect reviewers to test this PR: 👓

Checklist:

@DanStough DanStough added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport signals that a PR will not contain a backport label labels Aug 30, 2023
Copy link
Member

@zalimeni zalimeni left a comment

Choose a reason for hiding this comment

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

This is looking great to me, and I really appreciate having your test setup as an example while I'm trying to write my own.

Some non-blocking comments about potential shared helpers, but overall what you have so far looks reasonable to me. Will look forward to seeing any other feedback around functional req's.

control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
control-plane/connect-inject/controllers/pod/pod.go Outdated Show resolved Hide resolved
@DanStough DanStough force-pushed the dans/NET-5315/v2-pods-controller branch from be40389 to 86f7cbb Compare August 30, 2023 19:27
@DanStough DanStough force-pushed the dans/NET-5315/v2-pods-controller branch 2 times, most recently from 6b7d186 to cd88fa0 Compare August 31, 2023 13:47
@DanStough DanStough force-pushed the dans/NET-5315/v2-pods-controller branch from cd88fa0 to ea4d003 Compare August 31, 2023 15:30
@zalimeni zalimeni mentioned this pull request Aug 31, 2023
2 tasks
Copy link
Contributor

@ndhanushkodi ndhanushkodi left a comment

Choose a reason for hiding this comment

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

The testing is 🎉


err = pc.writeWorkload(context.Background(), *tc.pod)
require.NoError(t, err)

Copy link
Contributor

Choose a reason for hiding this comment

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

Does there need to be a ResourceHasPersisted check here before the read in L175?

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 think it's not needed here because we are doing a read after write, and in this case, we don't care if the Consul controller has reconciled the resource yet. In the other cases, we are overwriting/deleting resources, which had the CAS behavior at the time of testing.

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 could also totally be mistaken, so please correct me. I didn't see any flakes with the test, unlike the others.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the other cases, we are overwriting/deleting resources, which had the CAS behavior at the time of testing.

Ah ok, so the delete wasn't going through sometimes, unless you know consul has persisted? As opposed to in this case, the read is being done from some higher level client/cache?

I think that makes sense, I just wanted to understand the difference between this case and the others! If you ran something like a -count=100 without flakes I think it's fine!

@DanStough DanStough merged commit 8c44e1d into main Sep 5, 2023
3 checks passed
@DanStough DanStough deleted the dans/NET-5315/v2-pods-controller branch September 5, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport signals that a PR will not contain a backport label pr/no-changelog PR does not need a corresponding .changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants