Skip to content

Conversation

@MisterMX
Copy link
Collaborator

@MisterMX MisterMX commented Oct 9, 2025

Description of your changes

This adds namespace variants for the current provider-argocd API types. It moves the apis into apis/cluster/ and adds the new one in apis/namespace/. The same is done for pkg/controllers and pkg/clients.

Following the convention established by the upjet providers the new resources are put in the m.argocd.crossplane.io API groups to avoid conflicts with existing CRDs (i.e. Project.projects.m.argocd.crossplane.io).

Note: This PR is still a draft and the namespace controllers need to be fully implemented yet. As of now I couldn't come up with an elegant way to have one controller for both types and relied on plain copy-past for now. For some of these copy task I created a simple tool: https://github.com/MisterMX/copystruct.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Only the existing unit test which are copied, for now.

@MisterMX MisterMX force-pushed the feat/crossplane-cluster-namespace-apis branch 4 times, most recently from 8d8d06c to 3ee8895 Compare October 13, 2025 14:35
@MisterMX MisterMX marked this pull request as ready for review October 13, 2025 14:43
@MisterMX MisterMX force-pushed the feat/crossplane-cluster-namespace-apis branch from 3ee8895 to 1294419 Compare October 13, 2025 14:49
Copy link
Collaborator

@christophrj christophrj left a comment

Choose a reason for hiding this comment

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

thanks for the great work and tackling the v2 transition for provider argocd @MisterMX

@MisterMX MisterMX force-pushed the feat/crossplane-cluster-namespace-apis branch from 1294419 to 23b29b2 Compare October 14, 2025 10:04
Intermediate commit to let git keep track of the correct file renames
dues to a "cluster" directory already existing in apis/, but that
contains different files.

Signed-off-by: MisterMX <[email protected]>
Intermediate commit to let git keep track of all files

Signed-off-by: MisterMX <[email protected]>
- Use copystruct to copy API types
- Use generic wrapper to reuse existing cluster logic
- Use goverter to convert between cluster and namespace types
- Test everything by copying and minimally adapting cluster controller
tests

Signed-off-by: MisterMX <[email protected]>
@MisterMX MisterMX force-pushed the feat/crossplane-cluster-namespace-apis branch from 23b29b2 to a7a8a84 Compare October 14, 2025 10:09
@haarchri
Copy link
Member

@MisterMX can you add safeStart cap too - makes ot compatible with MRAPs - thanks for xref: https://github.com/crossplane-contrib/provider-upjet-aws/blob/main/cmd/provider/accessanalyzer/zz_main.go#L266

@MisterMX
Copy link
Collaborator Author

@MisterMX can you add safeStart cap too - makes ot compatible with MRAPs - thanks for xref: crossplane-contrib/provider-upjet-aws@main/cmd/provider/accessanalyzer/zz_main.go#L266

@haarchri I have never heard of safe start and MRAP? What is it about and what do I need to do to implement it?

@haarchri
Copy link
Member

haarchri commented Oct 15, 2025

@MisterMX
Copy link
Collaborator Author

Thanks for the link. From what it looks like, this feature seems a bit too much for this PR and should be added separately. I created an issue to track this: #353.

Copy link
Collaborator

@christophrj christophrj left a comment

Choose a reason for hiding this comment

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

👍

@MisterMX MisterMX merged commit 87cd8d7 into crossplane-contrib:main Oct 15, 2025
7 checks passed
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.

3 participants