Skip to content

Commit

Permalink
Implement IMetadata interface (#998)
Browse files Browse the repository at this point in the history
* V1PodTemplateSpec implements IMetadata interface

This will allow using the ModelExteions methods over V1PodTemplateSpec

* Typo
  • Loading branch information
stan-sz authored Sep 12, 2022
1 parent 13cc644 commit 21c41e7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/customResource/CustomResourceDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CustomResourceDefinition
public string Namespace { get; set; }
}

public abstract class CustomResource : KubernetesObject
public abstract class CustomResource : KubernetesObject, IMetadata<V1ObjectMeta>
{
[JsonPropertyName("metadata")]
public V1ObjectMeta Metadata { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient.Models/NodeMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace k8s.Models
/// <summary>
/// Describes the resource usage metrics of a node pull from metrics server API.
/// </summary>
public class NodeMetrics
public class NodeMetrics : IMetadata<V1ObjectMeta>
{
/// <summary>
/// The kubernetes standard object's metadata.
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient.Models/NodeMetricsList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace k8s.Models
{
public class NodeMetricsList
public class NodeMetricsList : IMetadata<V1ObjectMeta>
{
/// <summary>
/// Defines the versioned schema of this representation of an object.
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient.Models/PodMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace k8s.Models
/// <summary>
/// Describes the resource usage metrics of a pod pull from metrics server API.
/// </summary>
public class PodMetrics
public class PodMetrics : IMetadata<V1ObjectMeta>
{
/// <summary>
/// The kubernetes standard object's metadata.
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient.Models/PodMetricsList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace k8s.Models
{
public class PodMetricsList
public class PodMetricsList : IMetadata<V1ObjectMeta>
{
/// <summary>
/// Defines the versioned schema of this representation of an object.
Expand Down
10 changes: 10 additions & 0 deletions src/KubernetesClient.Models/V1PodTemplateSpec.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace k8s.Models
{
/// <summary>
/// Partial implementation of the IMetadata interface
/// to open this class up to ModelExtensions methods
/// </summary>
public partial class V1PodTemplateSpec : IMetadata<V1ObjectMeta>
{
}
}

0 comments on commit 21c41e7

Please sign in to comment.