@@ -45,7 +45,10 @@ public interface IKubernetesClient<TEntity> : IDisposable
45
45
/// </summary>
46
46
/// <param name="downwardApiEnvName">Customizable name of the env var to check for the namespace.</param>
47
47
/// <returns>A string containing the current namespace (or a fallback of it).</returns>
48
- Task < string > GetCurrentNamespace ( string downwardApiEnvName = "POD_NAMESPACE" ) ;
48
+ Task < string > GetCurrentNamespaceAsync ( string downwardApiEnvName = "POD_NAMESPACE" ) ;
49
+
50
+ /// <inheritdoc cref="GetCurrentNamespaceAsync" />
51
+ string GetCurrentNamespace ( string downwardApiEnvName = "POD_NAMESPACE" ) ;
49
52
50
53
/// <summary>
51
54
/// Fetch and return an entity from the Kubernetes API.
@@ -56,15 +59,18 @@ public interface IKubernetesClient<TEntity> : IDisposable
56
59
/// If it is omitted, the entity must be a cluster wide entity.
57
60
/// </param>
58
61
/// <returns>The found entity of the given type, or null otherwise.</returns>
59
- Task < TEntity ? > Get ( string name , string ? @namespace = null ) ;
62
+ Task < TEntity ? > GetAsync ( string name , string ? @namespace = null ) ;
63
+
64
+ /// <inheritdoc cref="GetAsync"/>
65
+ TEntity ? Get ( string name , string ? @namespace = null ) ;
60
66
61
67
/// <summary>
62
68
/// Fetch and return a list of entities from the Kubernetes API.
63
69
/// </summary>
64
70
/// <param name="namespace">If the entities are namespaced, provide the name of the namespace.</param>
65
71
/// <param name="labelSelector">A string, representing an optional label selector for filtering fetched objects.</param>
66
72
/// <returns>A list of Kubernetes entities.</returns>
67
- Task < IList < TEntity > > List (
73
+ Task < IList < TEntity > > ListAsync (
68
74
string ? @namespace = null ,
69
75
string ? labelSelector = null ) ;
70
76
@@ -76,7 +82,17 @@ Task<IList<TEntity>> List(
76
82
/// </param>
77
83
/// <param name="labelSelectors">A list of label-selectors to apply to the search.</param>
78
84
/// <returns>A list of Kubernetes entities.</returns>
79
- Task < IList < TEntity > > List (
85
+ Task < IList < TEntity > > ListAsync (
86
+ string ? @namespace = null ,
87
+ params LabelSelector [ ] labelSelectors ) ;
88
+
89
+ /// <inheritdoc cref="ListAsync(string?,string?)"/>
90
+ IList < TEntity > List (
91
+ string ? @namespace = null ,
92
+ string ? labelSelector = null ) ;
93
+
94
+ /// <inheritdoc cref="ListAsync(string?,LabelSelector[])"/>
95
+ IList < TEntity > List (
80
96
string ? @namespace = null ,
81
97
params LabelSelector [ ] labelSelectors ) ;
82
98
@@ -86,61 +102,89 @@ Task<IList<TEntity>> List(
86
102
/// </summary>
87
103
/// <param name="entity">The entity in question.</param>
88
104
/// <returns>The saved instance of the entity.</returns>
89
- async Task < TEntity > Save ( TEntity entity ) => await Get ( entity . Name ( ) , entity . Namespace ( ) ) switch
105
+ async Task < TEntity > SaveAsync ( TEntity entity ) => await GetAsync ( entity . Name ( ) , entity . Namespace ( ) ) switch
106
+ {
107
+ { } e => await UpdateAsync ( entity . WithResourceVersion ( e ) ) ,
108
+ _ => await CreateAsync ( entity ) ,
109
+ } ;
110
+
111
+ /// <inheritdoc cref="SaveAsync"/>
112
+ TEntity Save ( TEntity entity ) => Get ( entity . Name ( ) , entity . Namespace ( ) ) switch
90
113
{
91
- { } e => await Update ( entity . WithResourceVersion ( e ) ) ,
92
- _ => await Create ( entity ) ,
114
+ { } e => Update ( entity . WithResourceVersion ( e ) ) ,
115
+ _ => Create ( entity ) ,
93
116
} ;
94
117
95
118
/// <summary>
96
119
/// Create the given entity on the Kubernetes API.
97
120
/// </summary>
98
121
/// <param name="entity">The entity instance.</param>
99
122
/// <returns>The created instance of the entity.</returns>
100
- Task < TEntity > Create ( TEntity entity ) ;
123
+ Task < TEntity > CreateAsync ( TEntity entity ) ;
124
+
125
+ /// <inheritdoc cref="CreateAsync"/>
126
+ TEntity Create ( TEntity entity ) ;
101
127
102
128
/// <summary>
103
129
/// Update the given entity on the Kubernetes API.
104
130
/// </summary>
105
131
/// <param name="entity">The entity instance.</param>
106
132
/// <returns>The updated instance of the entity.</returns>
107
- Task < TEntity > Update ( TEntity entity ) ;
133
+ Task < TEntity > UpdateAsync ( TEntity entity ) ;
134
+
135
+ /// <inheritdoc cref="UpdateAsync"/>
136
+ TEntity Update ( TEntity entity ) ;
108
137
109
138
/// <summary>
110
139
/// Update the status object of a given entity on the Kubernetes API.
111
140
/// </summary>
112
141
/// <param name="entity">The entity that contains a status object.</param>
142
+ /// <returns>The entity with the updated status.</returns>
143
+ Task < TEntity > UpdateStatusAsync ( TEntity entity ) ;
144
+
145
+ /// <inheritdoc cref="UpdateStatusAsync"/>
146
+ TEntity UpdateStatus ( TEntity entity ) ;
147
+
148
+ /// <inheritdoc cref="Delete(TEntity)"/>
113
149
/// <returns>A task that completes when the call was made.</returns>
114
- public Task < TEntity > UpdateStatus ( TEntity entity ) ;
150
+ Task DeleteAsync ( TEntity entity ) ;
151
+
152
+ /// <inheritdoc cref="Delete(IEnumerable{TEntity})"/>
153
+ /// <returns>A task that completes when the call was made.</returns>
154
+ Task DeleteAsync ( IEnumerable < TEntity > entities ) ;
155
+
156
+ /// <inheritdoc cref="Delete(TEntity[])"/>
157
+ /// <returns>A task that completes when the call was made.</returns>
158
+ Task DeleteAsync ( params TEntity [ ] entities ) ;
159
+
160
+ /// <inheritdoc cref="Delete(string,string?)"/>
161
+ /// <returns>A task that completes when the call was made.</returns>
162
+ Task DeleteAsync ( string name , string ? @namespace = null ) ;
115
163
116
164
/// <summary>
117
165
/// Delete a given entity from the Kubernetes API.
118
166
/// </summary>
119
167
/// <param name="entity">The entity in question.</param>
120
- /// <returns>A task that completes when the call was made.</returns>
121
- Task Delete ( TEntity entity ) ;
168
+ void Delete ( TEntity entity ) ;
122
169
123
170
/// <summary>
124
171
/// Delete a given list of entities from the Kubernetes API.
125
172
/// </summary>
126
173
/// <param name="entities">The entities in question.</param>
127
- /// <returns>A task that completes when the calls were made.</returns>
128
- Task Delete ( IEnumerable < TEntity > entities ) ;
174
+ void Delete ( IEnumerable < TEntity > entities ) ;
129
175
130
176
/// <summary>
131
177
/// Delete a given list of entities from the Kubernetes API.
132
178
/// </summary>
133
179
/// <param name="entities">The entities in question.</param>
134
- /// <returns>A task that completes when the calls were made.</returns>
135
- Task Delete ( params TEntity [ ] entities ) ;
180
+ void Delete ( params TEntity [ ] entities ) ;
136
181
137
182
/// <summary>
138
183
/// Delete a given entity by name from the Kubernetes API.
139
184
/// </summary>
140
185
/// <param name="name">The name of the entity.</param>
141
186
/// <param name="namespace">The optional namespace of the entity.</param>
142
- /// <returns>A task that completes when the call was made.</returns>
143
- Task Delete ( string name , string ? @namespace = null ) ;
187
+ void Delete ( string name , string ? @namespace = null ) ;
144
188
145
189
/// <summary>
146
190
/// Create a entity watcher on the Kubernetes API.
0 commit comments