Commit Graph

14 Commits

Author SHA1 Message Date
Nic Cope 1121c851c5 Remove or relocate deprecated status conditions
The references resolved condition was marked deprecated in v0.8 and has no known
callers. The secret resolution success condition is only used by the target
controller.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-09 15:14:24 -07:00
Nic Cope 5b15db1f2a Make core status conditions CamelCase per API conventions
https://github.com/kubernetes/community/blob/493639d/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-09 14:47:24 -07:00
Nic Cope b9255d7fcc Simplify resource references, and introduce reference selection
This commit introduces managed.APISimpleReferenceResolver, which satisfies the
managed.ReferenceResolver interface. This variant requires much less plumbing
and reflection because it expects that managed resources expose a single
ResolveReferences method that will optionally select and then resolve any
resource references. It also adds a new pkg/reference which contains a library
that managed resource authors _may_ choose to use to avoid reimplementing common
reference selection and resolution logic.

The existing managed.APIReferenceResolver implementation remains the default,
but is marked deprecated and will be removed once all managed resources use the
APISimpleReferenceResolver. Notably, the "reference resolution" condition is no
longer set by managed.Reconciler - managed resources will report reference
resolution issues via the Synced condition (i.e. as a ReconcileError).

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-15 13:59:53 -07:00
Daniel Mangum 5ece4af54b Implement Target interface and reconciler (#103)
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-01-14 12:36:41 -08:00
Muvaffak Onus d449ca546b
make wording in conditions to cover resources other than managed ones
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2019-12-30 18:31:14 +03:00
Nic Cope bc04c33519 Resolve references on every reconcile
Reference resolution is now a no-op if nothing changes, so we run it on every
reconcile. We also run it after delete has been handled, so unresolved
references will only block creates and updates.

This commit means we'll make more get calls to the cache (or API) in order to
resolve our references each reconcile, and also risk potentially changing the
values of 'immutable' fields automatically if and when our references resources
change. I believe we should address this by having referencers be no-ops when
the field value they would set is already set.

I attempted to move reference resolution to right before we call create or
update (i.e. after observe and delete), but it turns out certain resources
(specifically GCP Connections) could need references to be resolved in order to
observe the external resource.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-10-31 16:11:10 -07:00
Nic Cope 604cfc074e Fix grammar in reference resolution condition message
Signed-off-by: Nic Cope <negz@rk0n.org>
2019-10-31 13:27:30 -07:00
soorena776 f063ec82d3 - Removing class level reference resolution if we can get away with it
- Removing the panic recovery logic
- Removing the superfluous IsConditionReady method
- Adding Nic's unit-tests for GetCondition and IsConditionTrue
- Minor other fixes

Signed-off-by: soorena776 <javad@upbound.io>
2019-10-21 17:05:15 -07:00
soorena776 8df7f7cab7 Change ReferenceResolver signature to accept CanReference type instead of Managed
Signed-off-by: soorena776 <javad@upbound.io>
2019-10-21 16:39:26 -07:00
soorena776 1c6cccad93 Adding GetCondition to the Managed API
Signed-off-by: soorena776 <javad@upbound.io>
2019-10-21 16:39:26 -07:00
Hasan Turken d449ffd87a Add WithMessage method on Condition
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2019-10-09 13:02:09 +03:00
Hasan Turken 2dc5eb54f1 Add UnavailableWithMessage condition helper
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2019-10-08 16:24:11 +03:00
Nic Cope 25243ed326 Clean up GoDoc for API types
The GoDoc strings for the API types are used to generate user visible
documentation, for example the API documentation and CRD fields. This commit
ensures the GoDoc is complete, and makes sense in the context of user facing
documentation.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-09-13 18:21:39 -07:00
hasheddan 5bde15f3b4 kubebuilderv2: migrate core apis and controllers
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Co-authored-by: Muvaffak Onus <onus.muvaffak@gmail.com>
Co-authored-by: Jared Watts <jbw976@gmail.com>
Co-authored-by: hasheddan <georgedanielmangum@gmail.com>
2019-08-13 17:38:42 -05:00