/
validatingWebhookConfiguration.ts
40 lines (36 loc) · 1.24 KB
/
validatingWebhookConfiguration.ts
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
import { apiFactory } from './apiProxy';
import { KubeObjectInterface, LabelSelector, makeKubeObject } from './cluster';
import { KubeRuleWithOperations, KubeWebhookClientConfig } from './mutatingWebhookConfiguration';
export interface KubeValidatingWebhookConfiguration extends KubeObjectInterface {
webhooks: {
admissionReviewVersions: string[];
clientConfig: KubeWebhookClientConfig;
failurePolicy?: string;
matchPolicy?: string;
name: string;
namespaceSelector?: {
matchExpressions: LabelSelector['matchExpressions'];
matchLabels: LabelSelector['matchLabels'];
};
objectSelector?: {
matchExpressions: LabelSelector['matchExpressions'];
matchLabels: LabelSelector['matchLabels'];
};
rules?: KubeRuleWithOperations[];
sideEffects?: string;
timeoutSeconds?: number;
}[];
}
class ValidatingWebhookConfiguration extends makeKubeObject<KubeValidatingWebhookConfiguration>(
'ValidatingWebhookConfiguration'
) {
static apiEndpoint = apiFactory(
'admissionregistration.k8s.io',
'v1',
'validatingwebhookconfigurations'
);
get webhooks(): KubeValidatingWebhookConfiguration['webhooks'] {
return this.jsonData!.webhooks;
}
}
export default ValidatingWebhookConfiguration;