@@ -25,6 +25,7 @@ import (
25
25
26
26
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
27
27
"github.com/crossplane/crossplane-runtime/pkg/fieldpath"
28
+ "github.com/crossplane/crossplane-runtime/pkg/resource/unstructured/reference"
28
29
)
29
30
30
31
// An Option modifies an unstructured composite resource claim.
@@ -63,21 +64,6 @@ type Unstructured struct {
63
64
unstructured.Unstructured
64
65
}
65
66
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
-
81
67
// GetUnstructured returns the underlying *unstructured.Unstructured.
82
68
func (c * Unstructured ) GetUnstructured () * unstructured.Unstructured {
83
69
return & c .Unstructured
@@ -112,16 +98,16 @@ func (c *Unstructured) SetCompositionReference(ref *corev1.ObjectReference) {
112
98
}
113
99
114
100
// 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 {}
117
103
if err := fieldpath .Pave (c .Object ).GetValueInto ("spec.compositionRevisionRef" , out ); err != nil {
118
104
return nil
119
105
}
120
106
return out
121
107
}
122
108
123
109
// SetCompositionRevisionReference of this resource claim.
124
- func (c * Unstructured ) SetCompositionRevisionReference (ref * corev1.ObjectReference ) {
110
+ func (c * Unstructured ) SetCompositionRevisionReference (ref * corev1.LocalObjectReference ) {
125
111
_ = fieldpath .Pave (c .Object ).SetValue ("spec.compositionRevisionRef" , ref )
126
112
}
127
113
@@ -170,22 +156,22 @@ func (c *Unstructured) GetCompositeDeletePolicy() *xpv1.CompositeDeletePolicy {
170
156
}
171
157
172
158
// 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 {}
175
161
if err := fieldpath .Pave (c .Object ).GetValueInto ("spec.resourceRef" , out ); err != nil {
176
162
return nil
177
163
}
178
164
return out
179
165
}
180
166
181
167
// SetResourceReference of this composite resource claim.
182
- func (c * Unstructured ) SetResourceReference (ref * corev1. ObjectReference ) {
168
+ func (c * Unstructured ) SetResourceReference (ref * reference. Composite ) {
183
169
_ = fieldpath .Pave (c .Object ).SetValue ("spec.resourceRef" , ref )
184
170
}
185
171
186
172
// 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 {
189
175
APIVersion : c .GetAPIVersion (),
190
176
Kind : c .GetKind (),
191
177
Name : c .GetName (),
0 commit comments