File tree Expand file tree Collapse file tree 10 files changed +68
-70
lines changed Expand file tree Collapse file tree 10 files changed +68
-70
lines changed Original file line number Diff line number Diff line change 1- // See https://aka.ms/new-console-template for more information
1+ // See https://aka.ms/new-console-template for more information
22using k8s ;
33using k8s . ClientSets ;
4+ using k8s . Models ;
45using System . Threading . Tasks ;
56
67namespace clientset
Original file line number Diff line number Diff line change 2020 <Compile Include =" ..\KubernetesClient\Extensions.cs" />
2121 <Compile Include =" ..\KubernetesClient\FloatEmitter.cs" />
2222 <Compile Include =" ..\KubernetesClient\Models\GeneratedModelVersion.cs" />
23- <Compile Include =" ..\KubernetesClient\IItems.cs" />
23+ <Compile Include =" ..\KubernetesClient\Models\ IItems.cs" />
2424 <Compile Include =" ..\KubernetesClient\IKubernetesObject.cs" />
25- <Compile Include =" ..\KubernetesClient\IMetadata.cs" />
25+ <Compile Include =" ..\KubernetesClient\Models\ IMetadata.cs" />
2626 <Compile Include =" ..\KubernetesClient\Models\IntOrStringJsonConverter.cs" />
2727 <Compile Include =" ..\KubernetesClient\Models\IntOrStringYamlConverter.cs" />
2828 <Compile Include =" ..\KubernetesClient\Models\IntstrIntOrString.cs" />
29- <Compile Include =" ..\KubernetesClient\ISpec.cs" />
30- <Compile Include =" ..\KubernetesClient\IStatus.cs" />
29+ <Compile Include =" ..\KubernetesClient\Models\ ISpec.cs" />
30+ <Compile Include =" ..\KubernetesClient\Models\ IStatus.cs" />
3131 <Compile Include =" ..\KubernetesClient\IValidate.cs" />
3232 <Compile Include =" ..\KubernetesClient\Models\KubernetesEntityAttribute.cs" />
3333 <Compile Include =" ..\KubernetesClient\Models\KubernetesList.cs" />
Original file line number Diff line number Diff line change 2222 <Compile Include =" ..\KubernetesClient\Extensions.cs" />
2323 <Compile Include =" ..\KubernetesClient\FloatEmitter.cs" />
2424 <Compile Include =" ..\KubernetesClient\Models\GeneratedModelVersion.cs" />
25- <Compile Include =" ..\KubernetesClient\IItems.cs" />
25+ <Compile Include =" ..\KubernetesClient\Models\ IItems.cs" />
2626 <Compile Include =" ..\KubernetesClient\IKubernetesObject.cs" />
27- <Compile Include =" ..\KubernetesClient\IMetadata.cs" />
27+ <Compile Include =" ..\KubernetesClient\Models\ IMetadata.cs" />
2828 <Compile Include =" ..\KubernetesClient\Models\IntOrStringJsonConverter.cs" />
2929 <Compile Include =" ..\KubernetesClient\Models\IntOrStringYamlConverter.cs" />
3030 <Compile Include =" ..\KubernetesClient\Models\IntstrIntOrString.cs" />
31- <Compile Include =" ..\KubernetesClient\ISpec.cs" />
32- <Compile Include =" ..\KubernetesClient\IStatus.cs" />
31+ <Compile Include =" ..\KubernetesClient\Models\ ISpec.cs" />
32+ <Compile Include =" ..\KubernetesClient\Models\ IStatus.cs" />
3333 <Compile Include =" ..\KubernetesClient\IValidate.cs" />
3434 <Compile Include =" ..\KubernetesClient\Models\KubernetesEntityAttribute.cs" />
3535 <Compile Include =" ..\KubernetesClient\KubernetesJson.cs" />
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ namespace k8s . Models ;
2+
3+ /// <summary>
4+ /// Kubernetes object that exposes list of objects
5+ /// </summary>
6+ /// <typeparam name="T">type of the objects</typeparam>
7+ public interface IItems < T >
8+ {
9+ /// <summary>
10+ /// Gets or sets list of objects. More info:
11+ /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
12+ /// </summary>
13+ IList < T > Items { get ; set ; }
14+ }
15+
16+ public static class ItemsExt
17+ {
18+ public static IEnumerator < T > GetEnumerator < T > ( this IItems < T > items )
19+ {
20+ if ( items is null )
21+ {
22+ throw new ArgumentNullException ( nameof ( items ) ) ;
23+ }
24+
25+ return items . Items . GetEnumerator ( ) ;
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ namespace k8s . Models ;
2+
3+ /// <summary>
4+ /// Kubernetes object that exposes metadata
5+ /// </summary>
6+ /// <typeparam name="T">Type of metadata exposed. Usually this will be either
7+ /// <see cref="V1ListMeta"/> for lists or <see cref="V1ObjectMeta"/> for objects</typeparam>
8+ public interface IMetadata < T >
9+ {
10+ /// <summary>
11+ /// Gets or sets standard object's metadata. More info:
12+ /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
13+ /// </summary>
14+ T Metadata { get ; set ; }
15+ }
Original file line number Diff line number Diff line change 1+ namespace k8s . Models ;
2+
3+ /// <summary>
4+ /// Represents a Kubernetes object that has a spec
5+ /// </summary>
6+ /// <typeparam name="T">type of Kubernetes object</typeparam>
7+ public interface ISpec < T >
8+ {
9+ /// <summary>
10+ /// Gets or sets specification of the desired behavior of the entity. More
11+ /// info:
12+ /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
13+ /// </summary>
14+ T Spec { get ; set ; }
15+ }
Original file line number Diff line number Diff line change 1- namespace k8s
1+ namespace k8s . Models
22{
33 /// <summary>
44 /// Kubernetes object that exposes status
You can’t perform that action at this time.
0 commit comments