@@ -92,7 +92,7 @@ public static V1ObjectMeta EnsureMetadata(this IMetadata<V1ObjectMeta> obj)
92
92
/// <summary>Gets the index of the <see cref="V1OwnerReference"/> that matches the given object, or -1 if no such
93
93
/// reference could be found.
94
94
/// </summary>
95
- public static int FindOwnerRef ( this IMetadata < V1ObjectMeta > obj , IKubernetesObject < V1ObjectMeta > owner )
95
+ public static int FindOwnerReference ( this IMetadata < V1ObjectMeta > obj , IKubernetesObject < V1ObjectMeta > owner )
96
96
{
97
97
var ownerRefs = obj . OwnerReferences ( ) ;
98
98
if ( ownerRefs != null )
@@ -131,13 +131,13 @@ public static string GetLabel(this IMetadata<V1ObjectMeta> obj, string key)
131
131
}
132
132
133
133
/// <summary>Creates a <see cref="V1ObjectReference"/> that refers to the given object.</summary>
134
- public static V1ObjectReference GetObjectReference < T > ( this T obj ) where T : IKubernetesObject , IMetadata < V1ObjectMeta >
134
+ public static V1ObjectReference GetObjectReference ( this IKubernetesObject < V1ObjectMeta > obj )
135
135
{
136
136
if ( obj == null ) throw new ArgumentNullException ( nameof ( obj ) ) ;
137
137
string apiVersion = obj . ApiVersion , kind = obj . Kind ; // default to using the API version and kind from the object
138
138
if ( string . IsNullOrEmpty ( apiVersion ) || string . IsNullOrEmpty ( kind ) ) // but if either of them is missing...
139
139
{
140
- object [ ] attrs = typeof ( T ) . GetCustomAttributes ( typeof ( KubernetesEntityAttribute ) , true ) ;
140
+ object [ ] attrs = obj . GetType ( ) . GetCustomAttributes ( typeof ( KubernetesEntityAttribute ) , true ) ;
141
141
if ( attrs . Length == 0 ) throw new ArgumentException ( "Unable to determine the object's API version and Kind." ) ;
142
142
var attr = ( KubernetesEntityAttribute ) attrs [ 0 ] ;
143
143
( apiVersion , kind ) = ( string . IsNullOrEmpty ( attr . Group ) ? attr . ApiVersion : attr . Group + "/" + attr . ApiVersion , attr . Kind ) ;
0 commit comments