Skip to content

Commit cae4430

Browse files
authored
Merge pull request #689 from devtron-labs/feat/edit-cluster
feat: integrate cluster config get apis and create cluster form
2 parents c495ff5 + e5ea790 commit cae4430

11 files changed

Lines changed: 219 additions & 102 deletions

File tree

Lines changed: 5 additions & 0 deletions
Loading

src/Assets/IconV2/ic-check.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/Assets/IconV2/ic-pencil.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/Pages/ResourceBrowser/service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ export const drainNodeCapacity = (
6060
abortControllerRef?: APIOptions['abortControllerRef'],
6161
): Promise<ResponseType> => put(`${ROUTES.NODE_CAPACITY}/drain`, requestPayload, { abortControllerRef })
6262

63-
export const getClusterListRaw = () => get<ClusterDetail[]>(ROUTES.CLUSTER_LIST_RAW)
63+
export const getClusterListRaw = (abortControllerRef?: APIOptions['abortControllerRef']) =>
64+
get<ClusterDetail[]>(ROUTES.CLUSTER_LIST_RAW, { abortControllerRef })

src/Pages/ResourceBrowser/types.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import { Dispatch, SetStateAction, ReactElement } from 'react'
18+
import { InstallationClusterType } from '@Shared/index'
1819
import { NodeActionRequest } from './ResourceBrowser.Types'
1920

2021
export enum ClusterFiltersType {
@@ -23,10 +24,21 @@ export enum ClusterFiltersType {
2324
UNHEALTHY = 'unhealthy',
2425
}
2526

27+
export enum InstallationClusterStatus {
28+
Creating = 'Creating',
29+
Updating = 'Updating',
30+
Installed = 'Installed',
31+
Failed = 'Failed',
32+
Superseded = 'Superseded',
33+
Undefined = 'Undefined',
34+
}
35+
2636
export enum ClusterStatusType {
2737
HEALTHY = 'healthy',
2838
UNHEALTHY = 'unhealthy',
2939
CONNECTION_FAILED = 'connection failed',
40+
CREATING = 'creating',
41+
UPDATING = 'updating',
3042
}
3143

3244
export interface ResourceDetail {
@@ -64,13 +76,15 @@ export interface ClusterCapacityType {
6476
nodeErrors: Record<string, string>[]
6577
status?: ClusterStatusType
6678
isProd: boolean
79+
installationId?: number
6780
}
6881

6982
export interface ClusterDetail extends ClusterCapacityType {
7083
id: number
7184
errorInNodeListing: string
7285
nodeNames?: string[]
7386
isVirtualCluster?: boolean
87+
isInstallationCluster?: boolean
7488
}
7589

7690
interface NodeCordonOptions {
@@ -98,3 +112,35 @@ export interface AdditionalConfirmationModalOptionsProps<T = unknown> {
98112
setOptionsData: Dispatch<SetStateAction<T>>
99113
children?: ReactElement
100114
}
115+
116+
export interface InstallationClusterStepType {
117+
lastTransitionTime: string
118+
lastProbeTime: string
119+
message: string
120+
reason: string
121+
status: 'False' | 'True' | 'Unknown'
122+
type: string
123+
}
124+
125+
export interface InstallationClusterConfigDTO {
126+
installationId: number
127+
installationStatus: InstallationClusterStatus
128+
name: string
129+
values: string
130+
valuesSchema: string
131+
isProd: boolean
132+
installationType: InstallationClusterType
133+
conditions: InstallationClusterStepType[]
134+
// NOTE: for installation cluster, that is creating this will be 0
135+
installedEntityId: number | 0
136+
}
137+
138+
export interface InstallationClusterConfigType
139+
extends Pick<InstallationClusterConfigDTO, 'installationType' | 'conditions'> {
140+
schema: object
141+
values: object
142+
installationId: number
143+
name: string
144+
status: InstallationClusterStatus
145+
correspondingClusterId: number | 0
146+
}

0 commit comments

Comments
 (0)