Commit Graph

12 Commits

Author SHA1 Message Date
Sergen Yalçın ac7cf2045e
Support for having circular dependencies while using referencers
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
2022-04-14 14:56:17 +03:00
Nic Cope af4e148a11 Replace github.com/pkg/errors with our own pkg/errors.
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-09 07:50:57 +00:00
smcavallo f2440d956a reference pointer utility function comments
Signed-off-by: smcavallo <smcavallo@hotmail.com>
2021-03-01 16:29:20 -05:00
smcavallo 4347499aee add pointer helper functions for slices for referencers
Signed-off-by: smcavallo <smcavallo@hotmail.com>
2021-03-01 10:21:21 -05:00
hasheddan 0b27607592
Update core/v1alpha1 imports to common/v1
Updates all core/v1alpha1 imports to the common/v1, which is the new
home of these embedded API types.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-11-19 20:03:48 -06:00
Nic Cope ba53a74b97 Clarify reference resolution errors slightly
This makes it a little more obvious where errors are happening; i.e. during
reference selection or resolution.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-06 16:19:53 -07:00
Nic Cope 3face651ef Support selecting and resolving arrays of references
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-16 19:51:16 -07:00
Nic Cope 211e232f1a Remove unused reference.Resolver interface
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-16 18:06:40 -07:00
Nic Cope e8ebeb9b32 Add convenience methods for references that resolve to a pointer string
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-16 18:05:03 -07:00
Nic Cope c8339c6c71 Return an error when reference resolution results in empty value
This will be the case when the referenced managed resource exists, but the field
from which we want to extract a value is empty. Consider for example a status
field that does not have a useful value until the resource has been created.
Blocking on the referenced resource field being non-zero is roughly equivalent
to blocking on the referenced resource being in condition Ready.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-15 19:00:24 -07:00
Nic Cope 1ac8ded427 Docstring fixes.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-15 14:48:38 -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