-
Notifications
You must be signed in to change notification settings - Fork 91
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
Can't create cross resource reference if the terraform field type is Number #91
Comments
I just wanted to say that I've started working on implementing support for cross-resource references for other primitives than string. So far I've added support for From my understanding, the best way to solve this is by updating the The initial commit for supporting this can be found in my fork of crossplane-runtime and crossplane-tools E.g. in the case where the the source is of type for i3 := 0; i3 < len(mg.Spec.ForProvider.Reviewers); i3++ {
mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{
-- CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Reviewers[i3].Teams),
++ CurrentValues: reference.FromFloatPtrValues(mg.Spec.ForProvider.Reviewers[i3].Teams),
Extract: reference.ExternalName(),
References: mg.Spec.ForProvider.Reviewers[i3].TeamsRefs,
Selector: mg.Spec.ForProvider.Reviewers[i3].TeamsSelector,
To: reference.To{
List: &v1alpha1.TeamList{},
Managed: &v1alpha1.Team{},
},
})
if err != nil {
return errors.Wrap(err, "mg.Spec.ForProvider.Reviewers[i3].Teams")
}
-- mg.Spec.ForProvider.Reviewers[i3].Teams = reference.ToPtrValues(mrsp.ResolvedValues)
++ mg.Spec.ForProvider.Reviewers[i3].Teams = reference.ToFloatPtrValues(mrsp.ResolvedValues)
mg.Spec.ForProvider.Reviewers[i3].TeamsRefs = mrsp.ResolvedReferences
} Feel free to chime in if you have any ideas on how to solve this in a better way! 😄 |
Setting to severity:2 (low) as I'm assuming this doesn't happen very often also you still get a working API just reference functionality is missing. |
it hit me again in the new provider configuration, so maybe it is not super low :)
|
What happened?
See crossplane/terrajet#277
Referencing it for proper tracking within upjet
The text was updated successfully, but these errors were encountered: