Skip to content

Commit

Permalink
Add factory extension method for CRD v1 resource client
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Friedman authored and Adam Friedman committed Oct 1, 2024
1 parent 11270d8 commit 527f300
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,24 @@ public static ICustomResourceDefinitionClientV1Beta1 CustomResourceDefinitionsV1
client => new CustomResourceDefinitionClientV1Beta1(client)
);
}

/// <summary>
/// Get the Kubernetes CustomResourceDefinitions (v1) resource client.
/// </summary>
/// <param name="kubeClient">
/// The Kubernetes API client.
/// </param>
/// <returns>
/// The resource client.
/// </returns>
public static ICustomResourceDefinitionClientV1 CustomResourceDefinitionsV1(this KubeApiClient kubeClient)
{
if (kubeClient == null)
throw new ArgumentNullException(nameof(kubeClient));

return kubeClient.ResourceClient(
client => new CustomResourceDefinitionClientV1(client)
);
}
}
}

0 comments on commit 527f300

Please sign in to comment.