Drop internal/xresource - move back to pkg/resource from crossplane-runtime#6553
Drop internal/xresource - move back to pkg/resource from crossplane-runtime#6553negz merged 1 commit intocrossplane:mainfrom
internal/xresource - move back to pkg/resource from crossplane-runtime#6553Conversation
| // LocalConnectionSecretFor creates a connection secret in the namespace of the | ||
| // supplied LocalConnectionSecretOwner, assumed to be of the supplied kind. |
There was a problem hiding this comment.
We only use this once in the whole codebase so I just duplicated it here for now. We could go back to using the one in runtime once runtime's LocalConnectionSecretOwner and ConnectionSecretOwner doesn't require the type to have ESS support.
The ConnectionSecretFor helpers were never aware of ESS in the first place, but they expect a type that satisfies ConnectionSecretOwner as an argument, and we added the ESS getters and setters to that interface.
| type LocalConnectionSecretOwner interface { | ||
| resource.Object | ||
| resource.LocalConnectionSecretWriterTo | ||
| } |
There was a problem hiding this comment.
We could go back to using the ones defined in runtime's pkg/resource once those types drop ESS support.
That said, I'm a believer in defining the interfaces you use close to where you use them. So maybe we just leave it like this. I don't think it matters that much either way.
| // ConnectionSecretFor creates a connection for the supplied | ||
| // ConnectionSecretOwner, assumed to be of the supplied kind. The secret is | ||
| // written to 'default' namespace if the ConnectionSecretOwner does not specify | ||
| // a namespace. |
There was a problem hiding this comment.
See comment on LocalConnectionSecretFor. Same deal here.
| // Only legacy XRs support writing connection secrets. | ||
| lcp, ok := cp.(resource.LegacyComposite) | ||
| if !ok { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Calling attention to this since it's not boilerplate find/replace like most of the PR.
Go back to crossplane-runtime/pkg/resource, which now has these changes. Signed-off-by: Nic Cope <nicc@rk0n.org>
Description of your changes
Fixes #6505
See crossplane/crossplane-runtime#849 for related runtime change.
I've just made duplicates of the
ConnectionSecretOwnerinterfaces from crossplane-runtime. c/c just uses those interfaces as arguments to a couple of methods, but it doesn't need theConnectionSecretOwnerto have ESS support.The MR reconciler in runtime does still expect
ConnectionSecretOwnerto have ESS support, at least until we address crossplane/crossplane-runtime#842. Once we do that we could drop the ones I duplicated here, though it might actually be better to just define these simple interfaces here close to where they're used.Either way this allows us to address #6505 without coupling it to immediately dropping ESS support from providers.
I have:
Runearthly +reviewableto ensure this PR is ready for review.Added or updated unit tests.Added or updated e2e tests.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Followed the API promotion workflow if this PR introduces, removes, or promotes an API.Need help with this checklist? See the cheat sheet.