-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(web/nodepool): remove stateful type as extra field #112
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import { Switch } from '~/components/atoms/switch'; | |
import { NameIdView } from '~/console/components/name-id-view'; | ||
import { findNodePlan, nodePlans, provisionTypes } from './nodepool-utils'; | ||
import { IClusterContext } from '../_layout'; | ||
import {keyconstants} from "~/console/server/r-utils/key-constants"; | ||
|
||
type IDialog = IDialogBase<ExtractNodeType<INodepools>>; | ||
|
||
|
@@ -53,7 +54,7 @@ const Root = (props: IDialog) => { | |
taints: [], | ||
autoScale: props.data.spec.minCount !== props.data.spec.maxCount, | ||
isNameError: false, | ||
stateful: props.data.stateful || false | ||
stateful: props.data.spec.nodeLabels[keyconstants.nodepoolStateType] || false | ||
} | ||
: { | ||
nvidiaGpuEnabled: false, | ||
|
@@ -155,9 +156,11 @@ const Root = (props: IDialog) => { | |
maxCount: Number.parseInt(val.maximum, 10), | ||
minCount: Number.parseInt(val.minimum, 10), | ||
cloudProvider: 'aws', | ||
nodeLabels: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (llm): Given the addition of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (llm): It's essential to test the merging behavior of |
||
[keyconstants.nodepoolStateType]: val.stateful ? "stateful" : "stateless" | ||
}, | ||
...getNodeConf(), | ||
}, | ||
stateful: val.stateful || false | ||
}, | ||
}); | ||
if (e) { | ||
|
@@ -173,11 +176,14 @@ const Root = (props: IDialog) => { | |
}, | ||
spec: { | ||
...props.data.spec, | ||
nodeLabels: { | ||
...(props.data.spec.nodeLabels || {}), | ||
[keyconstants.nodepoolStateType]: val.stateful ? "stateful" : "stateless" | ||
}, | ||
maxCount: Number.parseInt(val.maximum, 10), | ||
minCount: Number.parseInt(val.minimum, 10), | ||
...getNodeConf(), | ||
}, | ||
stateful: val.stateful || false | ||
}, | ||
}); | ||
if (e) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({ | |
} | ||
creationTime | ||
displayName | ||
stateful | ||
kind | ||
lastUpdatedBy { | ||
userEmail | ||
|
@@ -79,6 +78,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({ | |
cloudProvider | ||
maxCount | ||
minCount | ||
nodeLabels | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (llm): With the introduction of |
||
} | ||
status { | ||
checks | ||
|
@@ -158,7 +158,6 @@ export const nodepoolQueries = (executor: IExecutor) => ({ | |
} | ||
creationTime | ||
displayName | ||
stateful | ||
lastUpdatedBy { | ||
userEmail | ||
userId | ||
|
@@ -201,6 +200,7 @@ export const nodepoolQueries = (executor: IExecutor) => ({ | |
cloudProvider | ||
maxCount | ||
minCount | ||
nodeLabels | ||
} | ||
status { | ||
checks | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,7 +318,6 @@ export type SearchNamespaces = { | |
}; | ||
|
||
export type SearchNodepool = { | ||
isStateful?: InputMaybe<MatchFilterIn>; | ||
text?: InputMaybe<MatchFilterIn>; | ||
}; | ||
|
||
|
@@ -962,7 +961,6 @@ export type NodePoolIn = { | |
kind?: InputMaybe<Scalars['String']['input']>; | ||
metadata?: InputMaybe<MetadataIn>; | ||
spec: Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodePoolSpecIn; | ||
stateful: Scalars['Boolean']['input']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (llm): Ensure that the removal of the |
||
}; | ||
|
||
export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodePoolSpecIn = | ||
|
@@ -2016,7 +2014,6 @@ export type ConsoleGetNodePoolQuery = { | |
clusterName: string; | ||
creationTime: any; | ||
displayName: string; | ||
stateful: boolean; | ||
kind?: string; | ||
markedForDeletion?: boolean; | ||
updateTime: any; | ||
|
@@ -2035,6 +2032,7 @@ export type ConsoleGetNodePoolQuery = { | |
cloudProvider: Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider; | ||
maxCount: number; | ||
minCount: number; | ||
nodeLabels?: any; | ||
aws?: { | ||
availabilityZone: string; | ||
iamInstanceProfileRole?: string; | ||
|
@@ -2104,7 +2102,6 @@ export type ConsoleListNodePoolsQuery = { | |
clusterName: string; | ||
creationTime: any; | ||
displayName: string; | ||
stateful: boolean; | ||
markedForDeletion?: boolean; | ||
recordVersion: number; | ||
updateTime: any; | ||
|
@@ -2115,6 +2112,7 @@ export type ConsoleListNodePoolsQuery = { | |
cloudProvider: Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider; | ||
maxCount: number; | ||
minCount: number; | ||
nodeLabels?: any; | ||
aws?: { | ||
availabilityZone: string; | ||
nvidiaGpuEnabled: boolean; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): I noticed the transition from a direct boolean flag to using a label to indicate statefulness. It's crucial to ensure that all possible values of
nodeLabels[keyconstants.nodepoolStateType]
are covered in tests, including cases where it might be undefined or have unexpected values.