Mark ReferenceTo as deprecated

ReferenceTo returns a pointer to an ObjectReference, which should be
avoided in favor of a more scoped reference type.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This commit is contained in:
hasheddan 2020-09-07 16:27:42 -05:00
parent c9515a5a0e
commit adb65bc635
No known key found for this signature in database
GPG Key ID: BD68BC686A14C271
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ const (
// ReferenceTo returns an object reference to the supplied object, presumed to // ReferenceTo returns an object reference to the supplied object, presumed to
// be of the supplied group, version, and kind. // be of the supplied group, version, and kind.
// Deprecated: use a more specific reference type, such as TypedReference or
// Reference instead of the overly verbose ObjectReference.
// See https://github.com/crossplane/crossplane-runtime/issues/49
func ReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference { func ReferenceTo(o metav1.Object, of schema.GroupVersionKind) *corev1.ObjectReference {
v, k := of.ToAPIVersionAndKind() v, k := of.ToAPIVersionAndKind()
return &corev1.ObjectReference{ return &corev1.ObjectReference{