Skip to content

Commit

Permalink
feat(k8s): deprecate ReplaceNode (use DeleteNode instead) (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Jul 28, 2022
1 parent 0628e8a commit e6342ec
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packages/clients/src/api/k8s/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ export class K8SV1GenAPI extends API {
* pods (in a one node cluster for instance), you may experience some
* disruption of your applications.
*
* @deprecated
* @param request - The request {@link ReplaceNodeRequest}
* @returns A Promise of Node
*/
Expand Down Expand Up @@ -592,6 +593,14 @@ export class K8SV1GenAPI extends API {
unmarshalNode,
)

/**
* This method allows to delete a specific node. Note that when there is not
* enough space to reschedule all the pods (in a one node cluster for
* instance), you may experience some disruption of your applications.
*
* @param request - The request {@link DeleteNodeRequest}
* @returns A Promise of Node
*/
deleteNode = (request: Readonly<DeleteNodeRequest>) =>
this.client.fetch<Node>(
{
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/k8s/v1/content.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const NODE_TRANSIENT_STATUSES: NodeStatus[] = [
'deleting',
'rebooting',
'upgrading',
'starting',
]

/** Lists transient statutes of the enum {@link PoolStatus}. */
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/k8s/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const unmarshalNode = (data: unknown) => {
clusterId: data.cluster_id,
conditions: data.conditions,
createdAt: unmarshalDate(data.created_at),
errorMessage: data.error_message,
id: data.id,
name: data.name,
poolId: data.pool_id,
Expand Down
9 changes: 6 additions & 3 deletions packages/clients/src/api/k8s/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export type NodeStatus =
| 'rebooting'
| 'creation_error'
| 'upgrading'
| 'starting'

export type PoolStatus =
| 'unknown'
Expand Down Expand Up @@ -461,12 +462,14 @@ export interface Node {
/** The public IPv6 address of the node */
publicIpV6?: string
/**
* These conditions contains the Node Problem Detector conditions, as well as
* some in house conditions.
* @deprecated These conditions contains the Node Problem Detector conditions,
* as well as some in house conditions.
*/
conditions: Record<string, string>
conditions?: Record<string, string>
/** The status of the node */
status: NodeStatus
/** Details of the error, if any occured when managing the node */
errorMessage?: string
/** The date at which the node was created */
createdAt?: Date
/** The date at which the node was last updated */
Expand Down

0 comments on commit e6342ec

Please sign in to comment.