-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconstants.tsx
More file actions
116 lines (108 loc) · 4.34 KB
/
constants.tsx
File metadata and controls
116 lines (108 loc) · 4.34 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* Copyright (c) 2024. Devtron Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ReactComponent as ICCleanBrush } from '@Icons/ic-medium-clean-brush.svg'
import { ReactComponent as ICMediumPause } from '@Icons/ic-medium-pause.svg'
import { ReactComponent as ICMediumPlay } from '@Icons/ic-medium-play.svg'
import { SelectPickerOptionType } from '@Shared/Components'
import { NodeDrainRequest } from './types'
export const ALL_NAMESPACE_OPTION: Readonly<Pick<SelectPickerOptionType<string>, 'value' | 'label'>> = {
value: 'all',
label: 'All namespaces',
}
export const DRAIN_NODE_MODAL_MESSAGING = {
DrainIcon: ICCleanBrush,
GracePeriod: {
heading: 'Grace period',
infoText:
'Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.',
},
DeleteEmptyDirectoryData: {
heading: 'Delete empty directory data',
infoText: 'Enabling this field will delete the pods using empty directory data when the node is drained.',
},
DisableEviction: {
heading: 'Disable eviction (use with caution)',
infoText: `Enabling this field will force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets.
Note: Make sure to use with caution.`,
},
ForceDrain: {
heading: 'Force drain',
infoText:
'Enabling this field will force drain a node even if there are pods that do not declare a controller.',
},
IgnoreDaemonSets: {
heading: 'Ignore DaemonSets',
infoText: 'Enabling this field will ignore DaemonSet-managed pods.',
},
Actions: {
infoText: 'Drain will cordon off the node and evict all pods of the node.',
drain: 'Drain',
draining: 'Draining node',
cancel: 'Cancel',
},
}
export const CORDON_NODE_MODAL_MESSAGING = {
UncordonIcon: ICMediumPlay,
CordonIcon: ICMediumPause,
cordonInfoText:
'Cordoning a node will mark it as unschedulable. By cordoning a node, you can be sure that no new pods will be scheduled on the node.',
uncordonInfoText:
'Uncordoning this node will mark this node as schedulable. By uncordoning a node, you will allow pods to be scheduled on this node.',
cordon: 'Cordon',
uncordon: 'Uncordon',
cordoning: 'Cordoning node',
uncordoning: 'Uncordoning node',
cancel: 'Cancel',
}
export const DELETE_NODE_MODAL_MESSAGING = {
subtitle: (
<p className="fs-13 fw-4 cn-8 m-0">
Drain the node before deleting it as it may cause disruption because of pod deletion.
<br />
<br />
Are you sure you want to delete this node?
</p>
),
successInfoToastMessage: 'Node deletion initiated',
}
export const NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG: {
key: Exclude<keyof NodeDrainRequest['nodeDrainOptions'], 'gracePeriodSeconds'>
infoText: string
label: string
}[] = [
{
key: 'deleteEmptyDirData',
infoText: DRAIN_NODE_MODAL_MESSAGING.DeleteEmptyDirectoryData.infoText,
label: DRAIN_NODE_MODAL_MESSAGING.DeleteEmptyDirectoryData.heading,
},
{
key: 'disableEviction',
infoText: DRAIN_NODE_MODAL_MESSAGING.DisableEviction.infoText,
label: DRAIN_NODE_MODAL_MESSAGING.DisableEviction.heading,
},
{
key: 'force',
infoText: DRAIN_NODE_MODAL_MESSAGING.ForceDrain.infoText,
label: DRAIN_NODE_MODAL_MESSAGING.ForceDrain.heading,
},
{
key: 'ignoreAllDaemonSets',
infoText: DRAIN_NODE_MODAL_MESSAGING.IgnoreDaemonSets.infoText,
label: DRAIN_NODE_MODAL_MESSAGING.IgnoreDaemonSets.heading,
},
] as const
export const GVK_FILTER_KIND_QUERY_PARAM_KEY = 'gvkFilterKind'
export const GVK_FILTER_API_VERSION_QUERY_PARAM_KEY = 'gvkFilterApiVersion'