|
| 1 | +import type { KubernetesObject, Metadata, ResourceList } from "./types"; |
1 | 2 | import type { |
2 | | - KubernetesObject, |
3 | | - Metadata, |
4 | | - ResourceList, |
5 | | - KeyToPath, |
6 | | - LabelSelector, |
7 | | -} from "./types"; |
| 3 | + Volume, |
| 4 | + ObjectFieldSelector, |
| 5 | + ResourceFieldSelector, |
| 6 | +} from "./volume"; |
8 | 7 |
|
9 | 8 | export interface PodObject extends KubernetesObject { |
10 | 9 | kind: "Pod"; |
@@ -61,17 +60,6 @@ interface EnvVarSource { |
61 | 60 | secretKeyRef?: SecretKeySelector; |
62 | 61 | } |
63 | 62 |
|
64 | | -interface ObjectFieldSelector { |
65 | | - apiVersion?: string; |
66 | | - fieldPath: string; |
67 | | -} |
68 | | - |
69 | | -interface ResourceFieldSelector { |
70 | | - containerName?: string; |
71 | | - resource: string; |
72 | | - divisor?: string; |
73 | | -} |
74 | | - |
75 | 63 | interface ConfigMapKeySelector { |
76 | 64 | name?: string; |
77 | 65 | key: string; |
@@ -147,87 +135,6 @@ interface Toleration { |
147 | 135 | value?: string; |
148 | 136 | } |
149 | 137 |
|
150 | | -export interface Volume { |
151 | | - name: string; |
152 | | - persistentVolumeClaim?: PersistentVolumeClaimVolumeSource; |
153 | | - hostPath?: HostPathVolumeSource; |
154 | | - projected?: ProjectedVolumeSource; |
155 | | - configMap?: ConfigMapVolumeSource; |
156 | | - secret?: SecretVolumeSource; |
157 | | - emptyDir?: EmptyDirVolumeSource; |
158 | | - ephemeral?: EphemeralVolumeSource; |
159 | | -} |
160 | | - |
161 | | -interface PersistentVolumeClaimVolumeSource { |
162 | | - claimName: string; |
163 | | - readOnly?: boolean; |
164 | | -} |
165 | | - |
166 | | -interface HostPathVolumeSource { |
167 | | - path: string; |
168 | | - type?: string; |
169 | | -} |
170 | | - |
171 | | -interface ProjectedVolumeSource { |
172 | | - defaultMode?: number; |
173 | | - sources?: VolumeProjection[]; |
174 | | -} |
175 | | - |
176 | | -interface VolumeProjection { |
177 | | - configMap?: ConfigMapProjection; |
178 | | - downwardAPI?: DownwardAPIProjection; |
179 | | - secret?: SecretProjection; |
180 | | - serviceAccountToken?: ServiceAccountTokenProjection; |
181 | | -} |
182 | | - |
183 | | -interface ConfigMapProjection { |
184 | | - name?: string; |
185 | | - items?: KeyToPath[]; |
186 | | - optional?: boolean; |
187 | | -} |
188 | | - |
189 | | -interface DownwardAPIProjection { |
190 | | - items?: DownwardAPIVolumeFile[]; |
191 | | -} |
192 | | - |
193 | | -interface SecretProjection { |
194 | | - name?: string; |
195 | | - items?: KeyToPath[]; |
196 | | - optional?: boolean; |
197 | | -} |
198 | | - |
199 | | -interface ServiceAccountTokenProjection { |
200 | | - audience?: string; |
201 | | - expirationSeconds?: number; |
202 | | - path: string; |
203 | | -} |
204 | | - |
205 | | -interface DownwardAPIVolumeFile { |
206 | | - fieldRef?: ObjectFieldSelector; |
207 | | - mode?: number; |
208 | | - path: string; |
209 | | - resourceFieldRef?: ResourceFieldSelector; |
210 | | -} |
211 | | - |
212 | | -interface ConfigMapVolumeSource { |
213 | | - name?: string; |
214 | | - defaultMode?: number; |
215 | | - items?: KeyToPath[]; |
216 | | - optional?: boolean; |
217 | | -} |
218 | | - |
219 | | -interface SecretVolumeSource { |
220 | | - secretName?: string; |
221 | | - defaultMode?: number; |
222 | | - items?: KeyToPath[]; |
223 | | - optional?: boolean; |
224 | | -} |
225 | | - |
226 | | -interface EmptyDirVolumeSource { |
227 | | - medium?: string; |
228 | | - sizeLimit?: string; |
229 | | -} |
230 | | - |
231 | 138 | interface PodStatus { |
232 | 139 | conditions?: PodCondition[]; |
233 | 140 | phase: "Pending" | "Running" | "Succeeded" | "Failed" | "Unknown"; |
@@ -291,58 +198,3 @@ interface PodCondition { |
291 | 198 | message?: string; |
292 | 199 | reason?: string; |
293 | 200 | } |
294 | | - |
295 | | -export interface Volume { |
296 | | - name: string; |
297 | | - volumeSource: VolumeSource; |
298 | | -} |
299 | | - |
300 | | -export interface VolumeSource { |
301 | | - hostPath?: HostPathVolumeSource; |
302 | | - emptyDir?: EmptyDirVolumeSource; |
303 | | - secret?: SecretVolumeSource; |
304 | | - persistentVolumeClaim?: PersistentVolumeClaimVolumeSource; |
305 | | - configMap?: ConfigMapVolumeSource; |
306 | | - ephemeral?: EphemeralVolumeSource; |
307 | | -} |
308 | | - |
309 | | -export type HostPathType = |
310 | | - | "" |
311 | | - | "DirectoryOrCreate" |
312 | | - | "Directory" |
313 | | - | "FileOrCreate" |
314 | | - | "File" |
315 | | - | "Socket" |
316 | | - | "CharDevice" |
317 | | - | "BlockDevice"; |
318 | | - |
319 | | -export interface EphemeralVolumeSource { |
320 | | - volumeClaimTemplate?: PersistentVolumeClaimTemplate; |
321 | | -} |
322 | | - |
323 | | -export interface PersistentVolumeClaimTemplate { |
324 | | - metadata?: Metadata; |
325 | | - spec: PersistentVolumeClaimSpec; |
326 | | -} |
327 | | - |
328 | | -export type PersistentVolumeAccessMode = |
329 | | - | "ReadWriteOnce" |
330 | | - | "ReadOnlyMany" |
331 | | - | "ReadWriteMany" |
332 | | - | "ReadWriteOncePod"; |
333 | | - |
334 | | -export interface VolumeResourceRequirements { |
335 | | - limits?: ResourceList; |
336 | | - requests?: ResourceList; |
337 | | -} |
338 | | - |
339 | | -export type PersistentVolumeMode = "Block" | "Filesystem"; |
340 | | - |
341 | | -export interface PersistentVolumeClaimSpec { |
342 | | - accessModes?: PersistentVolumeAccessMode[]; |
343 | | - selector?: LabelSelector; |
344 | | - resources?: VolumeResourceRequirements; |
345 | | - volumeName?: string; |
346 | | - storageClassName?: string; |
347 | | - volumeMode?: PersistentVolumeMode; |
348 | | -} |
0 commit comments