-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace InfraDef and InfraPub with XRD #1679
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hasheddan
approved these changes
Aug 20, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✔️
negz
force-pushed
the
xrd
branch
2 times, most recently
from
August 22, 2020 02:48
5e7759b
to
55960da
Compare
I was hoping to take this out of draft today, but I underestimated how much work it would be to test it and update the docs. I need to:
|
negz
force-pushed
the
xrd
branch
3 times, most recently
from
August 25, 2020 02:52
5825436
to
2df029d
Compare
hasheddan
reviewed
Aug 25, 2020
Originally we had planned to have both application and infrastructure focused composite resources. We've since changed our approach to applications, and thus "composite resource" and "composite infrastructure resource" have become synonymous. We tend to say "composite resource" by convention, and thus "composite resource definition" fits as the definition of a composite resource. We're using 'XRD' as the abbreviation to avoid confusion with CRDs. This commit also renames InfrastructurePublication to CompositeResourcePublication. We plan to roll this concept into the XRD rather than a distinct resource in a future commit. Signed-off-by: Nic Cope <negz@rk0n.org>
See crossplane/crossplane-runtime#187 for context. Signed-off-by: Nic Cope <negz@rk0n.org>
This commit removes the CompositeResourcePublication (XRP) type, replacing it with a field - spec.claimNames - on a CompositeResourceDefinition (XRD). An XRD that specifies claimNames will define both a composite resource and a composite resource claim - a namespaced CR that platform operators may use to offer the composite resource to their platform consumers. As a simplification I'm currently assuming that claim names are immutable once set. They may be added retroactively (i.e. to offer a claim for a composite that originally did not), but they may not be updated or removed once set. We could change this in future at the expense of some additional complexity but without breaking API changes if we so desired. I've also kept the claim-CRD-and-controller-wrangling code in its own controller in part because I prefer two quite complex reconcile loops to one really complex reconcile loop, and in part because it was a smaller change to the current code to do so. Signed-off-by: Nic Cope <negz@rk0n.org>
Signed-off-by: Nic Cope <negz@rk0n.org>
Previously we omitted this information, assuming it was easily inferrable due to the fact that a requirement for composite kind Foo was always of kind FooRequirement. This is no longer the case. Signed-off-by: Nic Cope <negz@rk0n.org>
I don't think these are worth the effort to maintain. We have extensive examples in the docs, including snippets that can easily be applied, and we're starting work on an even more extensive example repository. Signed-off-by: Nic Cope <negz@rk0n.org>
This documentation update should capture: * The migration from InfraDef and InfraPub to XRD * The switch from 'requirement' to 'claim' * The removal of the concept of 'publishing' infrastructure Signed-off-by: Nic Cope <negz@rk0n.org>
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
Fixes #1615
Fixes #1682
Fixes #1683
This PR merges the
InfrastructureDefinition
andInfrastructurePublication
types into a new(ish) type;CompositeResourceDefinition
, aka "XRD". An XRD is identical to anInfrastructureDefinition
with the exception of itsspec.claimNames
field, which accepts an optional set of names that should be used to create a "composite resource claim". Composite resource claims replace the concept of a composite resource requirement - they act as a namespaced proxy for the composite resource.spec.claimNames
replaces the functionality formerly offered byInfrastructurePublication
. When an XRD specifies claim names it is said to "offer a resource claim", rather than "publish a resource requirement".Each commit in this PR has a little more context on what is changing. https://github.com/crossplane/example-cnp and particularly https://github.com/crossplane/example-cnp/issues/15 contains more context on how we landed on these concepts.
I will move the PR out of draft when it has been tested and the relevant documentation has been updated.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
I've run through all of the composition guides except for Alibaba. I don't seem to have working credentials, but I don't expect that guide to be broken given this PR only touches composition concepts.