Skip to content

Conversation

@jparsai
Copy link
Collaborator

@jparsai jparsai commented Feb 14, 2024

What does this PR do / why we need it:
This PR is to add support for cluster scoped Rollouts. Currently Rollouts controller can reconcile CR created in same namespace, this PR has changes which would allow Rollouts controller to reconcile CR created in other namespaces as well.
There are few limitations for creating Cluster scoped Rollouts controller, please check original issue created for this feature.

Have you updated the necessary documentation?

  • Documentation update is required by this PR, and has been updated.

Which issue(s) this PR fixes:
Fixes #?
#20

How to test changes / Special notes to the reviewer:

  1. Create RolloutManager CR and change scope to namespace or cluster using Spec.NamespaceScoped field of RolloutManager.
  2. Create Rollouts CR if RolloutManager is cluster scoped and it should be reconciled.
  3. Try combinations of cluster and namespace scoped Rollouts controller to confirm it works as expected and doesn't allow unsupported scenarios.

@jparsai jparsai force-pushed the cluster-scoped-rm branch 2 times, most recently from 99c1468 to 25a7148 Compare February 15, 2024 11:42
Copy link
Member

@jgwest jgwest left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Jayendra! See below for requested changes, but it's just minor stuff that I noticed while going the code (some of which was carried over from the original code)

In addition:

  • We should add ClusterRole/Binding to SetupWithManager, otherwise we won't be notified about changes to these resources

  • There are a few places where we are verifying that resources exist (for example, that a Deployment exists of name DefaultArgoRolloutsResourceName), but not the actual contents of those resource (for example, that the Deployment has the expected values inside)

    • I saw a couple spots where this was true, and it would be good to add some quick additional tests to verify resource contents:
      • In validateArgoRolloutManagerResources for E2E tests
      • argorollouts_controller_test.go (I know this came from the original test code, but can likely reuse the same code used for E2E tests here too)

@jparsai jparsai force-pushed the cluster-scoped-rm branch 3 times, most recently from b1e68ad to d44b4a9 Compare February 20, 2024 08:18
@jparsai
Copy link
Collaborator Author

jparsai commented Feb 20, 2024

Addressed all review comments, PTAL.

@jgwest
Copy link
Member

jgwest commented Feb 26, 2024

@jparsai did you miss pushing a commit, by chance? I started re-reviewing by checking the first two comments , and it seems like both are still present in the code.

@jparsai jparsai force-pushed the cluster-scoped-rm branch 2 times, most recently from 17af8b5 to 2ff4355 Compare February 26, 2024 10:55
@jparsai
Copy link
Collaborator Author

jparsai commented Feb 26, 2024

Yes @jgwest the first comment about duplicate import I had fixed but it seems when I copied some code from another file to rollout_test.go it was added again because of auto import in VSCode.

About 2nd comment I removed the error Type and using only one type "Reconciled", but Reason has to have multiple values.
Type=Reconciled | Status = true | Reason=Success | Message = ""
Type=Reconciled | Status = false | Reason=ErrorOccurred | Message = "Some error message"

I removed duplicate import, PTAL.

@jgwest
Copy link
Member

jgwest commented Feb 26, 2024

@jparsai Perfect, it's likely I misread reason and type, thanks for double checking!

@jparsai jparsai force-pushed the cluster-scoped-rm branch 7 times, most recently from a3b17ef to f59332c Compare March 15, 2024 11:26
@jparsai jparsai force-pushed the cluster-scoped-rm branch 6 times, most recently from 24bd76d to 4202d9a Compare March 28, 2024 09:46
@jparsai jparsai force-pushed the cluster-scoped-rm branch 2 times, most recently from 4ca92e8 to 967a1a7 Compare March 28, 2024 16:04
@jparsai
Copy link
Collaborator Author

jparsai commented Mar 28, 2024

@jgwest PR is ready for review now, PTAL.

Copy link
Member

@jgwest jgwest left a comment

Choose a reason for hiding this comment

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

Looks great! All that's is just some miscellaneous small items I noticed while reviewing,

@jparsai jparsai force-pushed the cluster-scoped-rm branch from 967a1a7 to a261150 Compare April 5, 2024 15:22
@jparsai jparsai force-pushed the cluster-scoped-rm branch from a261150 to 05a6505 Compare April 9, 2024 11:19
@jgwest jgwest merged commit 1c3ea3e into argoproj-labs:main Apr 10, 2024
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.

2 participants