-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtypes.ts
More file actions
77 lines (69 loc) · 1.7 KB
/
types.ts
File metadata and controls
77 lines (69 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.
// Configuration types
export interface SyncConfig {
configMap: {
name: string;
namespace?: string;
envFile?: string;
data?: Record<string, string>;
labels?: Record<string, string>;
annotations?: Record<string, string>;
};
output?: {
format?: "yaml" | "json";
pretty?: boolean;
};
}
// Kubernetes ConfigMap resource type
export interface ConfigMap {
apiVersion: "v1";
kind: "ConfigMap";
metadata: {
name: string;
namespace?: string;
labels?: Record<string, string>;
annotations?: Record<string, string>;
};
data?: Record<string, string>;
binaryData?: Record<string, string>;
}
// Kubernetes Secret resource type
export interface Secret {
apiVersion: "v1";
kind: "Secret";
metadata: {
name: string;
namespace?: string;
labels?: Record<string, string>;
annotations?: Record<string, string>;
};
data?: Record<string, string>;
stringData?: Record<string, string>;
type?: string;
}
export interface ConfigMapContext {
config: SyncConfig;
name: string;
namespace?: string;
data: Record<string, string>;
labels: Record<string, string>;
annotations: Record<string, string>;
}
export type ConfigMapBuilder = (
context: ConfigMapContext,
) => ConfigMap | null;
export type SecretBuilder = (
context: ConfigMapContext,
) => Secret | null;
// Kubectl command options
export interface KubectlResourceReference {
type: "configmap" | "secret";
name: string;
namespace?: string;
}
export interface SyncOptions {
resource: KubectlResourceReference;
env?: string;
format?: "yaml" | "json";
stringOnly?: boolean;
}