这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@erhancagirici
Copy link
Collaborator

Description of your changes

Generate namespace-friendly Go structs for namespaced MR types

  • embed v2.ManagedResourceSpec in MR Go types. This effectively makes:
    • spec.writeConnectionSecretToRef: connection secret refs as local references (without namespace)
    • remove spec.deletionPolicy from MR specs
    • remove spec.publishConnectionDetailsTo
  • generate local secret refs for sensitive parameters in spec.forProvider
    • handle local secret ref resolutions in runtime by injecting MR namespace
  • remove External Secret Store related code from controller templates.
  • generate optionally namespaced reference/selector fields for cross-resource references.
  • address various logging to include MR namespace info.
  • example generation pipeline now generates namespaced MR examples
  • bumps crossplane-runtime to v2
    • renamed all import paths to github.com/crossplane-runtime/v2/...
  • generate SetupGated functions for controllers, that allows CRD gated safe-start controller setup.
  • fixed an issue for resolver tooling ast parsing for imports.

addresses:
crossplane/crossplane#6457
crossplane/crossplane#6472
crossplane/crossplane#6460
crossplane/crossplane#6530

I have:

  • Read and followed Upjet'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 if necessary.

How has this code been tested

  • provider-upjet-aws
  • provider-upjet-azure
  • provider-upjet-gcp
  • provider-upjet-azuread

negz and others added 25 commits July 31, 2025 14:27
This PR is a no-op when I run it on provider-upjet-aws. It generates
exactly the same code as before this PR.

My goal is to allow invoking the main apis/controllers loop twice.
Once for cluster scoped and once for namespaced resources. I'll do
that in a follow-up PR.

Signed-off-by: Nic Cope <nicc@rk0n.org>
This is mostly a case of finding hard coded paths and assumptions and making
them configurable.

Signed-off-by: Nic Cope <nicc@rk0n.org>
Also take into account if there is a main.go template file when
generating controller setup and provider main.go files. There
will be no template in the monolith case, meaning we shoud generate
a consolidated controller setup and shouldn't generate main.go files
for each group.

Signed-off-by: Jared Watts <jbw976@gmail.com>
… namespaced config

Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
…y scenario

Signed-off-by: Jared Watts <jbw976@gmail.com>
- namespaced MR Go structs now inline v2-style ManagedResourceSpec in the type template
as a result:
- writeConnectionSecretToRef becomes a local secret ref in namespaced MRs
- providerConfigRef becomes a typed reference with kind included
- deletionPolicy gets removed in namespaced MRs
- publishConnectionDetailsTo gets removed from all MRs

Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
…mespaced MRs

- inject namespace to the local secret ref if MR is namespaced

- cross-namespace secret refs are effectively not allowed for namespaced MRs

Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
update sensitive tests
update types builder tests
add tests for FileProducer connection secret ref resolution
add namespaced tests for api callbacks

Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Signed-off-by: Erhan Cagirici <erhan@upbound.io>
Copy link
Member

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

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

Thanks @erhancagirici for your tremendous effort for upjet v2!

@erhancagirici erhancagirici merged commit 8ff6217 into main Aug 1, 2025
13 checks passed
@pavansokkenagaraj
Copy link

@erhancagirici @sergenyalcin
Any plans on updating https://github.com/crossplane/upjet-provider-template to align with v2?
I wanted to build a new provider and wanted to know the steps involved for v2. TIA

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.

6 participants