Skip to content

Commit 6976558

Browse files
committed
Rename a function
1 parent ff64d67 commit 6976558

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/KubernetesClient/ModelExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static V1ObjectMeta EnsureMetadata(this IMetadata<V1ObjectMeta> obj)
9292
/// <summary>Gets the index of the <see cref="V1OwnerReference"/> that matches the given object, or -1 if no such
9393
/// reference could be found.
9494
/// </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)
9696
{
9797
var ownerRefs = obj.OwnerReferences();
9898
if(ownerRefs != null)
@@ -131,13 +131,13 @@ public static string GetLabel(this IMetadata<V1ObjectMeta> obj, string key)
131131
}
132132

133133
/// <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)
135135
{
136136
if(obj == null) throw new ArgumentNullException(nameof(obj));
137137
string apiVersion = obj.ApiVersion, kind = obj.Kind; // default to using the API version and kind from the object
138138
if(string.IsNullOrEmpty(apiVersion) || string.IsNullOrEmpty(kind)) // but if either of them is missing...
139139
{
140-
object[] attrs = typeof(T).GetCustomAttributes(typeof(KubernetesEntityAttribute), true);
140+
object[] attrs = obj.GetType().GetCustomAttributes(typeof(KubernetesEntityAttribute), true);
141141
if(attrs.Length == 0) throw new ArgumentException("Unable to determine the object's API version and Kind.");
142142
var attr = (KubernetesEntityAttribute)attrs[0];
143143
(apiVersion, kind) = (string.IsNullOrEmpty(attr.Group) ? attr.ApiVersion : attr.Group + "/" + attr.ApiVersion, attr.Kind);

0 commit comments

Comments
 (0)