@@ -25,6 +25,7 @@ import (
2525
2626 xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
2727 "github.com/crossplane/crossplane-runtime/pkg/fieldpath"
28+ "github.com/crossplane/crossplane-runtime/pkg/resource/unstructured/reference"
2829)
2930
3031// An Option modifies an unstructured composite resource claim.
@@ -63,21 +64,6 @@ type Unstructured struct {
6364 unstructured.Unstructured
6465}
6566
66- // Reference to a claim.
67- type Reference struct {
68- // APIVersion of the referenced claim.
69- APIVersion string `json:"apiVersion"`
70-
71- // Kind of the referenced claim.
72- Kind string `json:"kind"`
73-
74- // Name of the referenced claim.
75- Name string `json:"name"`
76-
77- // Namespace of the referenced claim.
78- Namespace string `json:"namespace"`
79- }
80-
8167// GetUnstructured returns the underlying *unstructured.Unstructured.
8268func (c * Unstructured ) GetUnstructured () * unstructured.Unstructured {
8369 return & c .Unstructured
@@ -112,16 +98,16 @@ func (c *Unstructured) SetCompositionReference(ref *corev1.ObjectReference) {
11298}
11399
114100// GetCompositionRevisionReference of this resource claim.
115- func (c * Unstructured ) GetCompositionRevisionReference () * corev1.ObjectReference {
116- out := & corev1.ObjectReference {}
101+ func (c * Unstructured ) GetCompositionRevisionReference () * corev1.LocalObjectReference {
102+ out := & corev1.LocalObjectReference {}
117103 if err := fieldpath .Pave (c .Object ).GetValueInto ("spec.compositionRevisionRef" , out ); err != nil {
118104 return nil
119105 }
120106 return out
121107}
122108
123109// SetCompositionRevisionReference of this resource claim.
124- func (c * Unstructured ) SetCompositionRevisionReference (ref * corev1.ObjectReference ) {
110+ func (c * Unstructured ) SetCompositionRevisionReference (ref * corev1.LocalObjectReference ) {
125111 _ = fieldpath .Pave (c .Object ).SetValue ("spec.compositionRevisionRef" , ref )
126112}
127113
@@ -170,22 +156,22 @@ func (c *Unstructured) GetCompositeDeletePolicy() *xpv1.CompositeDeletePolicy {
170156}
171157
172158// GetResourceReference of this composite resource claim.
173- func (c * Unstructured ) GetResourceReference () * corev1. ObjectReference {
174- out := & corev1. ObjectReference {}
159+ func (c * Unstructured ) GetResourceReference () * reference. Composite {
160+ out := & reference. Composite {}
175161 if err := fieldpath .Pave (c .Object ).GetValueInto ("spec.resourceRef" , out ); err != nil {
176162 return nil
177163 }
178164 return out
179165}
180166
181167// SetResourceReference of this composite resource claim.
182- func (c * Unstructured ) SetResourceReference (ref * corev1. ObjectReference ) {
168+ func (c * Unstructured ) SetResourceReference (ref * reference. Composite ) {
183169 _ = fieldpath .Pave (c .Object ).SetValue ("spec.resourceRef" , ref )
184170}
185171
186172// GetReference returns reference to this claim.
187- func (c * Unstructured ) GetReference () * Reference {
188- return & Reference {
173+ func (c * Unstructured ) GetReference () * reference. Claim {
174+ return & reference. Claim {
189175 APIVersion : c .GetAPIVersion (),
190176 Kind : c .GetKind (),
191177 Name : c .GetName (),
0 commit comments