Skip to content

Early resolve references returns a false positive error #1234

@RedbackThomson

Description

@RedbackThomson

Describe the bug
When using a resolved reference, the reconciler will throw a false positive just before it attempts to create the resource, due to the initial ResolveReferences setting the Spec fields.

The initial ResolveReferences (called before ReadOne) resolves the *Ref fields on the object and sets the corresponding concrete values on the spec. Later, just before calling Create, the reconciler calls ResolveReferences again . This time, since the spec fields have already been populated, the method returns an error saying that both resource reference wrapper and ID cannot be used together. The resource is therefore never created, and this reconciler loops indefinitely.

Steps to reproduce

  1. Create any resource with a *Ref field, and populate that field with a valid value.

Expected outcome
The resource should be created successfully, without any reconciliation issues.

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.priority/critical-urgentHighest priority. Must be actively worked on as someone's top priority right now.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions