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

refactor(controller): restructure controlplane commands #1658

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

hiddeco
Copy link
Contributor

@hiddeco hiddeco commented Mar 20, 2024

This is the "control plane" version of #1547.

While it does move things into a better direction by creating a better separation of concerns, this continues to be a candidate to be revised again when we have time.

Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for docs-kargo-akuity-io ready!

Name Link
🔨 Latest commit 1730061
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/6615c20557ded40007941383
😎 Deploy Preview https://deploy-preview-1658.kargo.akuity.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 357 lines in your changes are missing coverage. Please review.

Project coverage is 43.86%. Comparing base (e480493) to head (1730061).

Files Patch % Lines
cmd/controlplane/controller.go 0.00% 173 Missing ⚠️
cmd/controlplane/webhooks.go 0.00% 59 Missing ⚠️
cmd/controlplane/management_controller.go 0.00% 57 Missing ⚠️
cmd/controlplane/garbage_collector.go 0.00% 53 Missing ⚠️
cmd/controlplane/version.go 0.00% 11 Missing ⚠️
cmd/controlplane/api.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1658      +/-   ##
==========================================
- Coverage   44.04%   43.86%   -0.19%     
==========================================
  Files         207      207              
  Lines       13133    13187      +54     
==========================================
  Hits         5784     5784              
- Misses       7106     7160      +54     
  Partials      243      243              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hiddeco hiddeco force-pushed the refactor-controlplane-cmd branch from 71e6424 to 400c73a Compare March 20, 2024 22:34
@hiddeco hiddeco marked this pull request as ready for review March 20, 2024 22:35
@hiddeco hiddeco requested a review from a team as a code owner March 20, 2024 22:35
@hiddeco hiddeco changed the title refactor(controller): revamp controlplane commands refactor(controller): restructure controlplane commands Mar 20, 2024
@hiddeco hiddeco force-pushed the refactor-controlplane-cmd branch from 400c73a to 7ff76c6 Compare March 20, 2024 22:43
@krancour
Copy link
Member

At a glance this looks fantastic, and I agree it's a step in the right direction with room for further improvement.

I do want to put this off to v0.6.0 though.

@krancour krancour modified the milestones: v0.5.0, v0.6.0 Mar 21, 2024
Comment on lines 288 to 302
cacheOpts := cache.Options{} // Watches all namespaces by default
if o.AnalysisRunNamespace != "" {
// TODO: When NOT sharded, Kargo can simply create AnalysisRun
// resources in the project namespaces. When sharded, AnalysisRun
// resources must be created IN the shard clusters (not the Kargo
// control plane cluster) and project namespaces do not exist in the
// shard clusters. We need a place to put them, so for now we allow
// the user to specify a namespace that that exists on each shard for
// this purpose. Note that the namespace does not need to be the same
// on every shard. This may be one of the weaker points in our tenancy
// model and can stand to be improved.
cacheOpts.DefaultNamespaces = map[string]cache.Config{
o.AnalysisRunNamespace: {},
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This went away with #1706

Comment on lines 45 to 46
RolloutsKubeConfig string
AnalysisRunNamespace string
Copy link
Member

Choose a reason for hiding this comment

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

Both of these went away in #1706.

AnalysisRuns now live exclusively in the Kargo control plane, so there's never a need for a separate client nor a need to fall back on using any namespace that isn't a Project's own namespace.

)
}

func (o *controllerOptions) setupRolloutsManager(ctx context.Context) (manager.Manager, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Not needed since #1706

@krancour
Copy link
Member

krancour commented Apr 5, 2024

Apart from conflicts with #1706, this looks good.

hiddeco added 5 commits April 10, 2024 00:17
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco force-pushed the refactor-controlplane-cmd branch from 7ff76c6 to 1730061 Compare April 9, 2024 22:32
@hiddeco
Copy link
Contributor Author

hiddeco commented Apr 9, 2024

Think I managed to rebase this correctly, but a careful look with a second pair of 👀 would be much appreciated.

@krancour
Copy link
Member

krancour commented Apr 9, 2024

@hiddeco it looked good before rebase... I'm just going to run it.

@krancour
Copy link
Member

krancour commented Apr 9, 2024

Works flawlessly. Startup logs look just like they did before. A few e2e cases all check out.

Copy link
Member

@krancour krancour left a comment

Choose a reason for hiding this comment

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

🔥

@hiddeco hiddeco added this pull request to the merge queue Apr 9, 2024
Merged via the queue into akuity:main with commit 33e702a Apr 9, 2024
14 of 16 checks passed
@hiddeco hiddeco deleted the refactor-controlplane-cmd branch April 9, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants