Skip to content

Migrate to Crossplane v2#81

Merged
ytsarev merged 12 commits intoupbound:mainfrom
ytsarev:v2
Jan 20, 2026
Merged

Migrate to Crossplane v2#81
ytsarev merged 12 commits intoupbound:mainfrom
ytsarev:v2

Conversation

@ytsarev
Copy link
Copy Markdown
Member

@ytsarev ytsarev commented Jan 20, 2026

Description of your changes

Migrates configuration-gitops-flux from v1 to v2 with namespaced resources.

Changes:

  • Provider-helm v0 → v1 (namespaced resources with .m API suffix)
  • XRD v1 → v2 with scope: Namespaced
  • Resource kind: XFlux → Flux
  • deletionPolicy → managementPolicies: ["*"]
  • Added kind: "ProviderConfig" to provider references
  • Renamed apis/xflux/ → apis/flux/

Breaking Changes:
⚠️ Existing v1 XFlux resources will not auto-migrate. Users must:

  1. Add namespace field to resources
  2. Update kind to Flux
  3. Replace deletionPolicy with managementPolicies

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

✅ All composition tests passing
✅ E2E tests updated with Crossplane v2.1.3-up.2
✅ Build and linting successful

ytsarev and others added 11 commits January 19, 2026 20:39
This updates provider-helm from v0 to v1, enabling generation of v1
namespaced models with the .m API group suffix.

The v1 models are generated in .up/kcl/models/io/crossplane/helmm/
(helmm with double 'm') and will be used in subsequent KCL function
updates for Crossplane v2 migration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update apiVersion from v1 to v2
- Add required scope: Namespaced field
- Remove "X" prefix from resource kind (XFlux → Flux)
- Update metadata.name to match new plural (xflux → flux)
- Replace deletionPolicy parameter with managementPolicies array
- Update kubeConfigSecretRef description for v2 namespace handling
- Maintain all existing parameters and schema structure
- Update metadata.name: xflux.gitops.platform.upbound.io → flux.gitops.platform.upbound.io
- Update compositeTypeRef.kind: XFlux → Flux
- Update step name: xflux → flux
- Keep functionRef.name as upbound-configuration-gitops-fluxxflux (matches function directory)
…ed resources

- Update import from helm to helmm (namespaced models)
- Change oxr type from XFlux to Flux
- Replace deletionPolicy with managementPolicies
- Add providerConfigRef.kind to both Helm Release resources
- Use conditional field assignment pattern for kubeConfig to avoid null values
- Changed kind from XFlux to Flux
- Added namespace: default field (required for namespaced resources)
- Replaced deletionPolicy: Delete with managementPolicies: ["*"]
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Renamed directory apis/xflux to apis/flux for consistency with v2 resource kind
- Updated README to reflect current Crossplane v2 state:
  - Added Crossplane v2 section explaining key characteristics
  - Updated file paths from /apis/xflux/ to /apis/flux/
  - Added example usage section with complete Flux XR example
  - Clarified namespaced resource requirements
  - Documented managementPolicies and provider-helm v1 usage
- Updated test references in tests/test-xflux/main.k

The directory rename ensures consistency between the resource kind (Flux)
and the directory structure, improving developer experience.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Yury Tsarev <yury@upbound.io>
@ytsarev ytsarev requested a review from a team as a code owner January 20, 2026 09:14
condition

Workaround to mitigate race condition like

```
up: error: unable to execute e2e tests: failed to apply extra resources: failed to apply resource ProviderConfig/default: providerconfigs.aws.m.***.io "default" is forbidden: User "***:robot:***-bot" cannot patch resource "providerconfigs" in API group "aws.m.***.io" in the namespace "default"
```

Signed-off-by: Yury Tsarev <yury@upbound.io>
Comment thread tests/e2etest-xflux/main.k
Copy link
Copy Markdown
Collaborator

@kaessert kaessert left a comment

Choose a reason for hiding this comment

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

lgtm :)

@ytsarev ytsarev merged commit b21d1ef into upbound:main Jan 20, 2026
3 checks passed
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.

3 participants