Skip to content
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

Fix support for static provisioning #24

Merged
merged 3 commits into from
Sep 15, 2019
Merged

Conversation

negz
Copy link
Member

@negz negz commented Sep 14, 2019

Description of your changes

This PR fixes support for managed resources that do not reference a class. Controllers built against crossplane-runtime will currently panic if they encounter a managed resource without a class reference. Any dynamically provisioned managed resource will have a class reference, but this breaks the static provisioning workflow in which a managed resource is explicitly provisioned, then later claimed.

The PR also fixes watch predicates for the static binding flow We currently support dynamic provisioning in the resource claim reconciler by using a watch predicate that allows either managed resources that directly reference a non-portable resource class of a given kind, or resource claims that reference a non-portable resource class of a given kind indirectly via a portable resource class.

To support static provisioning (i.e. explicitly claiming an existing managed resource) we must also allow resource claims that explicitly reference a managed resource. Writing one predicate to do all of this was getting cumbersome, so I have refactored the predicate interface a little.

This PR will require additional PRs to update Crossplane core, and each stack.

Checklist

I have:

  • Run make reviewable to ensure this PR is ready for review.
  • Ensured this PR contains a neat, self documenting set of commits.
  • Updated any relevant documentation, examples, or release notes.
  • Updated the RBAC permissions in clusterrole.yaml to include any new types.

Controllers built against crossplane-runtime will currently panic if they
encounter a managed resource without a class reference. Any dynamically
provisioned managed resource will have a class reference, but this breaks
the static provisioning workflow.

Signed-off-by: Nic Cope <negz@rk0n.org>
negz added a commit to negz/provider-gcp that referenced this pull request Sep 14, 2019
crossplane/crossplane-runtime#24

Use the static binding compatible predicates introduced in the above PR.

Signed-off-by: Nic Cope <negz@rk0n.org>
@negz
Copy link
Member Author

negz commented Sep 14, 2019

I've tested that both the static and dynamic provisioning flows work by using a build of crossplane-contrib/provider-gcp#24 to statically and then dynamically provision a CloudMemorystoreInstance and bind it to a RedisCluster.

negz added a commit to negz/provider-azure that referenced this pull request Sep 14, 2019
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Signed-off-by: Nic Cope <negz@rk0n.org>
negz added a commit to negz/provider-aws that referenced this pull request Sep 14, 2019
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Signed-off-by: Nic Cope <negz@rk0n.org>
Copy link
Member

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

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

Reviewed in conjunction with crossplane-contrib/provider-gcp#24. LGTM!

pkg/resource/predicates.go Outdated Show resolved Hide resolved
pkg/resource/predicates.go Outdated Show resolved Hide resolved
pkg/resource/predicates.go Show resolved Hide resolved
We currently support dynamic provisioning in the resource claim reconciler
by using a watch predicate that allows either managed resources that directly
reference a non-portable resource class of a given kind, or resource claims that
reference a non-portable resource class of a given kind indirectly via a
portable resource class.

To support static provisioning (i.e. explicitly claiming an existing managed
resource) we must also allow resource claims that explicitly reference a managed
resource. Writing one predicate to do all of this was getting cumbersome, so I
have refactored the predicate interface a little.

Signed-off-by: Nic Cope <negz@rk0n.org>
...because I am pedantic.

Signed-off-by: Nic Cope <negz@rk0n.org>
@negz negz merged commit 26a458d into crossplane:master Sep 15, 2019
@negz negz deleted the dontmove branch September 15, 2019 08:41
negz added a commit to negz/provider-gcp that referenced this pull request Sep 15, 2019
crossplane/crossplane-runtime#24

Use the static binding compatible predicates introduced in the above PR.

Note the updates to CRDs are due to recent documentation changes in core
fields exposed by crossplane-runtime.

Signed-off-by: Nic Cope <negz@rk0n.org>
negz added a commit to negz/provider-aws that referenced this pull request Sep 15, 2019
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Note the updates to CRDs are due to recent documentation changes in core
fields exposed by crossplane-runtime.

Signed-off-by: Nic Cope <negz@rk0n.org>
negz added a commit to negz/provider-azure that referenced this pull request Sep 15, 2019
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Note the updates to CRDs are due to recent documentation changes in core
fields exposed by crossplane-runtime.

Signed-off-by: Nic Cope <negz@rk0n.org>
wolffbe pushed a commit to wolffbe/provider-aws that referenced this pull request Feb 12, 2021
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Note the updates to CRDs are due to recent documentation changes in core
fields exposed by crossplane-runtime.

Signed-off-by: Nic Cope <negz@rk0n.org>
namku pushed a commit to namku/provider-aws that referenced this pull request Mar 9, 2021
crossplane/crossplane-runtime#24

Use the static provisioning compatible predicates introduced in the above PR.

Note the updates to CRDs are due to recent documentation changes in core
fields exposed by crossplane-runtime.
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.

None yet

3 participants