From 15486a601b6ad7746b8263401e204fa4bbdfd9cd Mon Sep 17 00:00:00 2001 From: Suyash Choudhary <57896905+sssash18@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:07:48 +0530 Subject: [PATCH 1/3] Added arch --- docs/documents/apis.md | 231 +++++++++--------- .../machine.sapcloud.io_machineclasses.yaml | 4 + pkg/apis/machine/types.go | 3 + .../machine/v1alpha1/machineclass_types.go | 3 + .../v1alpha1/zz_generated.conversion.go | 2 + pkg/openapi/openapi_generated.go | 10 +- 6 files changed, 143 insertions(+), 110 deletions(-) diff --git a/docs/documents/apis.md b/docs/documents/apis.md index 401062f35..c57715033 100644 --- a/docs/documents/apis.md +++ b/docs/documents/apis.md @@ -1,7 +1,7 @@ ## Specification ### ProviderSpec Schema
-

+

Machine

@@ -25,7 +25,7 @@ string -machine.sapcloud.io.v1alpha1 +machine.sapcloud.io/v1alpha1 @@ -63,7 +63,7 @@ Refer to the Kubernetes API documentation for the fields of the - + MachineSpec @@ -79,7 +79,7 @@ MachineSpec - + ClassSpec @@ -109,7 +109,7 @@ string - + NodeTemplateSpec @@ -125,7 +125,7 @@ NodeTemplateSpec - + MachineConfiguration @@ -147,7 +147,7 @@ MachineConfiguration - + MachineStatus @@ -159,7 +159,7 @@ MachineStatus
-

+

MachineClass

@@ -184,7 +184,7 @@ string -machine.sapcloud.io.v1alpha1 +machine.sapcloud.io/v1alpha1 @@ -222,7 +222,7 @@ Refer to the Kubernetes API documentation for the fields of the - + NodeTemplate @@ -294,7 +294,7 @@ Kubernetes core/v1.SecretReference
-

+

MachineDeployment

@@ -318,7 +318,7 @@ string -machine.sapcloud.io.v1alpha1 +machine.sapcloud.io/v1alpha1 @@ -357,7 +357,7 @@ Refer to the Kubernetes API documentation for the fields of the - + MachineDeploymentSpec @@ -406,7 +406,7 @@ selected by this will be the ones affected by this MachineDeployment.

- + MachineTemplateSpec @@ -421,7 +421,7 @@ MachineTemplateSpec - + MachineDeploymentStrategy @@ -483,7 +483,7 @@ MachineDeployment controller.

- + RollbackConfig @@ -522,7 +522,7 @@ by default, which is treated as infinite deadline.

- + MachineDeploymentStatus @@ -535,7 +535,7 @@ MachineDeploymentStatus
-

+

MachineSet

@@ -559,7 +559,7 @@ string -machine.sapcloud.io.v1alpha1 +machine.sapcloud.io/v1alpha1 @@ -597,7 +597,7 @@ Refer to the Kubernetes API documentation for the fields of the - + MachineSetSpec @@ -641,7 +641,7 @@ Kubernetes meta/v1.LabelSelector - + ClassSpec @@ -656,7 +656,7 @@ ClassSpec - + MachineTemplateSpec @@ -687,7 +687,7 @@ int32 - + MachineSetStatus @@ -699,13 +699,13 @@ MachineSetStatus
-

+

ClassSpec

(Appears on: -MachineSetSpec, -MachineSpec) +MachineSetSpec, +MachineSpec)

ClassSpec is the class specification of machine

@@ -761,23 +761,23 @@ string
-

+

ConditionStatus (string alias)

(Appears on: -MachineDeploymentCondition, -MachineSetCondition) +MachineDeploymentCondition, +MachineSetCondition)


-

+

CurrentStatus

(Appears on: -MachineStatus) +MachineStatus)

CurrentStatus contains information about the current status of Machine.

@@ -797,7 +797,7 @@ string - + MachinePhase @@ -835,14 +835,14 @@ Kubernetes meta/v1.Time
-

+

LastOperation

(Appears on: -MachineSetStatus, -MachineStatus, -MachineSummary) +MachineSetStatus, +MachineStatus, +MachineSummary)

LastOperation suggests the last operation performed on the object

@@ -904,7 +904,7 @@ Kubernetes meta/v1.Time - + MachineState @@ -919,7 +919,7 @@ MachineState - + MachineOperationType @@ -931,12 +931,12 @@ MachineOperationType
-

+

MachineConfiguration

(Appears on: -MachineSpec) +MachineSpec)

MachineConfiguration describes the configurations useful for the machine-controller.

@@ -1029,12 +1029,12 @@ Kubernetes meta/v1.Duration
-

+

MachineDeploymentCondition

(Appears on: -MachineDeploymentStatus) +MachineDeploymentStatus)

MachineDeploymentCondition describes the state of a MachineDeployment at a certain point.

@@ -1054,7 +1054,7 @@ Kubernetes meta/v1.Duration - + MachineDeploymentConditionType @@ -1069,7 +1069,7 @@ MachineDeploymentConditionType - + ConditionStatus @@ -1137,22 +1137,22 @@ string
-

+

MachineDeploymentConditionType (string alias)

(Appears on: -MachineDeploymentCondition) +MachineDeploymentCondition)


-

+

MachineDeploymentSpec

(Appears on: -MachineDeployment) +MachineDeployment)

MachineDeploymentSpec is the specification of the desired behavior of the MachineDeployment.

@@ -1204,7 +1204,7 @@ selected by this will be the ones affected by this MachineDeployment.

- + MachineTemplateSpec @@ -1219,7 +1219,7 @@ MachineTemplateSpec - + MachineDeploymentStrategy @@ -1281,7 +1281,7 @@ MachineDeployment controller.

- + RollbackConfig @@ -1314,12 +1314,12 @@ by default, which is treated as infinite deadline.


-

+

MachineDeploymentStatus

(Appears on: -MachineDeployment) +MachineDeployment)

MachineDeploymentStatus is the most recently observed status of the MachineDeployment.

@@ -1425,7 +1425,7 @@ either be machines that are running but not yet available or machines that still - + []MachineDeploymentCondition @@ -1456,7 +1456,7 @@ newest MachineSet.

- + []*github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary @@ -1469,12 +1469,12 @@ newest MachineSet.


-

+

MachineDeploymentStrategy

(Appears on: -MachineDeploymentSpec) +MachineDeploymentSpec)

MachineDeploymentStrategy describes how to replace existing machines with new ones.

@@ -1494,7 +1494,7 @@ newest MachineSet.

- + MachineDeploymentStrategyType @@ -1510,7 +1510,7 @@ MachineDeploymentStrategyType - + RollingUpdateMachineDeployment @@ -1526,44 +1526,44 @@ to be.


-

+

MachineDeploymentStrategyType (string alias)

(Appears on: -MachineDeploymentStrategy) +MachineDeploymentStrategy)


-

+

MachineOperationType (string alias)

(Appears on: -LastOperation) +LastOperation)

MachineOperationType is a label for the operation performed on a machine object.


-

+

MachinePhase (string alias)

(Appears on: -CurrentStatus) +CurrentStatus)

MachinePhase is a label for the condition of a machine at the current time.


-

+

MachineSetCondition

(Appears on: -MachineSetStatus) +MachineSetStatus)

MachineSetCondition describes the state of a machine set at a certain point.

@@ -1583,7 +1583,7 @@ to be.

- + MachineSetConditionType @@ -1598,7 +1598,7 @@ MachineSetConditionType - + ConditionStatus @@ -1654,23 +1654,23 @@ string
-

+

MachineSetConditionType (string alias)

(Appears on: -MachineSetCondition) +MachineSetCondition)

MachineSetConditionType is the condition on machineset object


-

+

MachineSetSpec

(Appears on: -MachineSet) +MachineSet)

MachineSetSpec is the specification of a MachineSet.

@@ -1718,7 +1718,7 @@ Kubernetes meta/v1.LabelSelector - + ClassSpec @@ -1733,7 +1733,7 @@ ClassSpec - + MachineTemplateSpec @@ -1758,12 +1758,12 @@ int32
-

+

MachineSetStatus

(Appears on: -MachineSet) +MachineSet)

MachineSetStatus holds the most recently observed status of MachineSet.

@@ -1852,7 +1852,7 @@ int64 - + []MachineSetCondition @@ -1868,7 +1868,7 @@ int64 - + LastOperation @@ -1883,7 +1883,7 @@ LastOperation - + []github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary @@ -1896,13 +1896,13 @@ LastOperation
-

+

MachineSpec

(Appears on: -Machine, -MachineTemplateSpec) +Machine, +MachineTemplateSpec)

MachineSpec is the specification of a Machine.

@@ -1922,7 +1922,7 @@ LastOperation - + ClassSpec @@ -1952,7 +1952,7 @@ string - + NodeTemplateSpec @@ -1968,7 +1968,7 @@ NodeTemplateSpec - + MachineConfiguration @@ -1984,23 +1984,23 @@ MachineConfiguration
-

+

MachineState (string alias)

(Appears on: -LastOperation) +LastOperation)

MachineState is a current state of the operation.


-

+

MachineStatus

(Appears on: -Machine) +Machine)

MachineStatus holds the most recently observed status of Machine.

@@ -2035,7 +2035,7 @@ MachineConfiguration - + LastOperation @@ -2050,7 +2050,7 @@ LastOperation - + CurrentStatus @@ -2077,7 +2077,7 @@ It can be used by future operation calls to determine current infrastucture stat
-

+

MachineSummary

@@ -2124,7 +2124,7 @@ string - + LastOperation @@ -2149,13 +2149,13 @@ string
-

+

MachineTemplateSpec

(Appears on: -MachineDeploymentSpec, -MachineSetSpec) +MachineDeploymentSpec, +MachineSetSpec)

MachineTemplateSpec describes the data a machine should have when created from a template

@@ -2194,7 +2194,7 @@ Refer to the Kubernetes API documentation for the fields of the - + MachineSpec @@ -2212,7 +2212,7 @@ More info: + ClassSpec @@ -2242,7 +2242,7 @@ string - + NodeTemplateSpec @@ -2258,7 +2258,7 @@ NodeTemplateSpec - + MachineConfiguration @@ -2277,12 +2277,12 @@ MachineConfiguration
-

+

NodeTemplate

(Appears on: -MachineClass) +MachineClass)

NodeTemplate contains subfields to track all node resources and other node info required to scale nodegroup from zero

@@ -2350,15 +2350,28 @@ string

Zone of the expected node belonging to nodeGroup

+ + +architecture + + + +string + + + +

Architecture of the node belonging to nodeGroup

+ +
-

+

NodeTemplateSpec

(Appears on: -MachineSpec) +MachineSpec)

NodeTemplateSpec describes the data a node should have when created from a template

@@ -2518,12 +2531,12 @@ see: https://issues.k8s.io/61966


-

+

RollbackConfig

(Appears on: -MachineDeploymentSpec) +MachineDeploymentSpec)

@@ -2553,12 +2566,12 @@ int64
-

+

RollingUpdateMachineDeployment

(Appears on: -MachineDeploymentStrategy) +MachineDeploymentStrategy)

Spec to control the desired behavior of rolling update.

diff --git a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml index 631e3a369..8fef7d51e 100644 --- a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml @@ -55,6 +55,9 @@ spec: description: NodeTemplate contains subfields to track all node resources and other node info required to scale nodegroup from zero properties: + architecture: + description: Architecture of the node belonging to nodeGroup + type: string capacity: additionalProperties: anyOf: @@ -75,6 +78,7 @@ spec: description: Zone of the expected node belonging to nodeGroup type: string required: + - architecture - capacity - instanceType - region diff --git a/pkg/apis/machine/types.go b/pkg/apis/machine/types.go index ab83b4226..8448625da 100644 --- a/pkg/apis/machine/types.go +++ b/pkg/apis/machine/types.go @@ -679,4 +679,7 @@ type NodeTemplate struct { // Zone of the node belonging to nodeGroup Zone string + + // Architecture of the node belonging to nodeGroup + Architecture string } diff --git a/pkg/apis/machine/v1alpha1/machineclass_types.go b/pkg/apis/machine/v1alpha1/machineclass_types.go index 6d525c338..a0c52fe83 100644 --- a/pkg/apis/machine/v1alpha1/machineclass_types.go +++ b/pkg/apis/machine/v1alpha1/machineclass_types.go @@ -84,4 +84,7 @@ type NodeTemplate struct { // Zone of the expected node belonging to nodeGroup Zone string `json:"zone"` + + // Architecture of the node belonging to nodeGroup + Architecture string `json:"architecture"` } diff --git a/pkg/apis/machine/v1alpha1/zz_generated.conversion.go b/pkg/apis/machine/v1alpha1/zz_generated.conversion.go index d912fa928..94f13aa17 100644 --- a/pkg/apis/machine/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/machine/v1alpha1/zz_generated.conversion.go @@ -1013,6 +1013,7 @@ func autoConvert_v1alpha1_NodeTemplate_To_machine_NodeTemplate(in *NodeTemplate, out.InstanceType = in.InstanceType out.Region = in.Region out.Zone = in.Zone + out.Architecture = in.Architecture return nil } @@ -1026,6 +1027,7 @@ func autoConvert_machine_NodeTemplate_To_v1alpha1_NodeTemplate(in *machine.NodeT out.InstanceType = in.InstanceType out.Region = in.Region out.Zone = in.Zone + out.Architecture = in.Architecture return nil } diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index e7f8c74fb..cd0b6325c 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -1597,8 +1597,16 @@ func schema_pkg_apis_machine_v1alpha1_NodeTemplate(ref common.ReferenceCallback) Format: "", }, }, + "architecture": { + SchemaProps: spec.SchemaProps{ + Description: "Architecture of the node belonging to nodeGroup", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, }, - Required: []string{"capacity", "instanceType", "region", "zone"}, + Required: []string{"capacity", "instanceType", "region", "zone", "architecture"}, }, }, Dependencies: []string{ From 96afff62a0caef4a6c632ece5c5743603e9c7311 Mon Sep 17 00:00:00 2001 From: Suyash Choudhary <57896905+sssash18@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:43:39 +0530 Subject: [PATCH 2/3] Added arch to nodetemplate --- docs/documents/apis.md | 3 ++- kubernetes/crds/machine.sapcloud.io_machineclasses.yaml | 1 - pkg/apis/machine/types.go | 3 ++- pkg/apis/machine/v1alpha1/machineclass_types.go | 3 ++- pkg/apis/machine/v1alpha1/zz_generated.conversion.go | 4 ++-- pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go | 5 +++++ pkg/apis/machine/zz_generated.deepcopy.go | 5 +++++ pkg/openapi/openapi_generated.go | 3 +-- 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/documents/apis.md b/docs/documents/apis.md index c57715033..3ae9dc3de 100644 --- a/docs/documents/apis.md +++ b/docs/documents/apis.md @@ -2356,10 +2356,11 @@ string -string +*string +(Optional)

Architecture of the node belonging to nodeGroup

diff --git a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml index 8fef7d51e..eaec3a83e 100644 --- a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml @@ -78,7 +78,6 @@ spec: description: Zone of the expected node belonging to nodeGroup type: string required: - - architecture - capacity - instanceType - region diff --git a/pkg/apis/machine/types.go b/pkg/apis/machine/types.go index 8448625da..aeab64ffb 100644 --- a/pkg/apis/machine/types.go +++ b/pkg/apis/machine/types.go @@ -680,6 +680,7 @@ type NodeTemplate struct { // Zone of the node belonging to nodeGroup Zone string + // +optional // Architecture of the node belonging to nodeGroup - Architecture string + Architecture *string } diff --git a/pkg/apis/machine/v1alpha1/machineclass_types.go b/pkg/apis/machine/v1alpha1/machineclass_types.go index a0c52fe83..6e50b6f16 100644 --- a/pkg/apis/machine/v1alpha1/machineclass_types.go +++ b/pkg/apis/machine/v1alpha1/machineclass_types.go @@ -85,6 +85,7 @@ type NodeTemplate struct { // Zone of the expected node belonging to nodeGroup Zone string `json:"zone"` + // +optional // Architecture of the node belonging to nodeGroup - Architecture string `json:"architecture"` + Architecture *string `json:"architecture,omitempty"` } diff --git a/pkg/apis/machine/v1alpha1/zz_generated.conversion.go b/pkg/apis/machine/v1alpha1/zz_generated.conversion.go index 94f13aa17..d2fdb8a02 100644 --- a/pkg/apis/machine/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/machine/v1alpha1/zz_generated.conversion.go @@ -1013,7 +1013,7 @@ func autoConvert_v1alpha1_NodeTemplate_To_machine_NodeTemplate(in *NodeTemplate, out.InstanceType = in.InstanceType out.Region = in.Region out.Zone = in.Zone - out.Architecture = in.Architecture + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) return nil } @@ -1027,7 +1027,7 @@ func autoConvert_machine_NodeTemplate_To_v1alpha1_NodeTemplate(in *machine.NodeT out.InstanceType = in.InstanceType out.Region = in.Region out.Zone = in.Zone - out.Architecture = in.Architecture + out.Architecture = (*string)(unsafe.Pointer(in.Architecture)) return nil } diff --git a/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go index 35b368e1a..d6096e635 100644 --- a/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go @@ -661,6 +661,11 @@ func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate) { (*out)[key] = val.DeepCopy() } } + if in.Architecture != nil { + in, out := &in.Architecture, &out.Architecture + *out = new(string) + **out = **in + } return } diff --git a/pkg/apis/machine/zz_generated.deepcopy.go b/pkg/apis/machine/zz_generated.deepcopy.go index e9bb94643..b0fa28c8f 100644 --- a/pkg/apis/machine/zz_generated.deepcopy.go +++ b/pkg/apis/machine/zz_generated.deepcopy.go @@ -754,6 +754,11 @@ func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate) { (*out)[key] = val.DeepCopy() } } + if in.Architecture != nil { + in, out := &in.Architecture, &out.Architecture + *out = new(string) + **out = **in + } return } diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index cd0b6325c..143af3140 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -1600,13 +1600,12 @@ func schema_pkg_apis_machine_v1alpha1_NodeTemplate(ref common.ReferenceCallback) "architecture": { SchemaProps: spec.SchemaProps{ Description: "Architecture of the node belonging to nodeGroup", - Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"capacity", "instanceType", "region", "zone", "architecture"}, + Required: []string{"capacity", "instanceType", "region", "zone"}, }, }, Dependencies: []string{ From 14bcdd0b76d2fa94b27a43f288ef6516977e9492 Mon Sep 17 00:00:00 2001 From: Suyash Choudhary <57896905+sssash18@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:34:33 +0530 Subject: [PATCH 3/3] Addressed review comments --- docs/documents/apis.md | 2 +- kubernetes/crds/machine.sapcloud.io_machineclasses.yaml | 2 +- pkg/apis/machine/types.go | 2 +- pkg/apis/machine/v1alpha1/machineclass_types.go | 2 +- pkg/openapi/openapi_generated.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/documents/apis.md b/docs/documents/apis.md index 3ae9dc3de..ef27e7b47 100644 --- a/docs/documents/apis.md +++ b/docs/documents/apis.md @@ -2361,7 +2361,7 @@ string (Optional) -

Architecture of the node belonging to nodeGroup

+

CPU Architecture of the node belonging to nodeGroup

diff --git a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml index eaec3a83e..653a65541 100644 --- a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml @@ -56,7 +56,7 @@ spec: and other node info required to scale nodegroup from zero properties: architecture: - description: Architecture of the node belonging to nodeGroup + description: CPU Architecture of the node belonging to nodeGroup type: string capacity: additionalProperties: diff --git a/pkg/apis/machine/types.go b/pkg/apis/machine/types.go index aeab64ffb..82172fc49 100644 --- a/pkg/apis/machine/types.go +++ b/pkg/apis/machine/types.go @@ -681,6 +681,6 @@ type NodeTemplate struct { Zone string // +optional - // Architecture of the node belonging to nodeGroup + // CPU Architecture of the node belonging to nodeGroup Architecture *string } diff --git a/pkg/apis/machine/v1alpha1/machineclass_types.go b/pkg/apis/machine/v1alpha1/machineclass_types.go index 6e50b6f16..85c2b426f 100644 --- a/pkg/apis/machine/v1alpha1/machineclass_types.go +++ b/pkg/apis/machine/v1alpha1/machineclass_types.go @@ -86,6 +86,6 @@ type NodeTemplate struct { Zone string `json:"zone"` // +optional - // Architecture of the node belonging to nodeGroup + // CPU Architecture of the node belonging to nodeGroup Architecture *string `json:"architecture,omitempty"` } diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index 143af3140..50bfee76d 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -1599,7 +1599,7 @@ func schema_pkg_apis_machine_v1alpha1_NodeTemplate(ref common.ReferenceCallback) }, "architecture": { SchemaProps: spec.SchemaProps{ - Description: "Architecture of the node belonging to nodeGroup", + Description: "CPU Architecture of the node belonging to nodeGroup", Type: []string{"string"}, Format: "", },