diff --git a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml index 9a2099b67..467ef109e 100644 --- a/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machineclasses.yaml @@ -56,6 +56,7 @@ spec: providerSpec: description: Provider-specific configuration to use during node creation. type: object + x-kubernetes-preserve-unknown-fields: true secretRef: description: SecretRef stores the necessary secrets such as credentials or userdata. diff --git a/kubernetes/crds/machine.sapcloud.io_machinedeployments.yaml b/kubernetes/crds/machine.sapcloud.io_machinedeployments.yaml index 8a5f5c207..24b5bfd2c 100644 --- a/kubernetes/crds/machine.sapcloud.io_machinedeployments.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machinedeployments.yaml @@ -204,6 +204,7 @@ spec: metadata: description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' type: object + x-kubernetes-preserve-unknown-fields: true spec: description: 'Specification of the desired behavior of the machine. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' @@ -250,6 +251,7 @@ spec: properties: metadata: type: object + x-kubernetes-preserve-unknown-fields: true spec: description: NodeSpec describes the attributes that a node is created with. diff --git a/kubernetes/crds/machine.sapcloud.io_machines.yaml b/kubernetes/crds/machine.sapcloud.io_machines.yaml index be3ed63d0..80c1839d3 100644 --- a/kubernetes/crds/machine.sapcloud.io_machines.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machines.yaml @@ -16,10 +16,21 @@ spec: singular: machine scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Current status of the machine. + jsonPath: .status.currentStatus.phase + name: Status + type: string + - description: |- + CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: - description: Machine TODO + description: Machine is the representation of a physical or virtual machine. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -76,6 +87,7 @@ spec: properties: metadata: type: object + x-kubernetes-preserve-unknown-fields: true spec: description: NodeSpec describes the attributes that a node is created with. diff --git a/kubernetes/crds/machine.sapcloud.io_machinesets.yaml b/kubernetes/crds/machine.sapcloud.io_machinesets.yaml index d3ddcaa9b..55222d45e 100644 --- a/kubernetes/crds/machine.sapcloud.io_machinesets.yaml +++ b/kubernetes/crds/machine.sapcloud.io_machinesets.yaml @@ -128,6 +128,7 @@ spec: metadata: description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' type: object + x-kubernetes-preserve-unknown-fields: true spec: description: 'Specification of the desired behavior of the machine. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' @@ -174,6 +175,7 @@ spec: properties: metadata: type: object + x-kubernetes-preserve-unknown-fields: true spec: description: NodeSpec describes the attributes that a node is created with. diff --git a/pkg/apis/machine/v1alpha1/machine_types.go b/pkg/apis/machine/v1alpha1/machine_types.go index a311d2f87..32d281272 100644 --- a/pkg/apis/machine/v1alpha1/machine_types.go +++ b/pkg/apis/machine/v1alpha1/machine_types.go @@ -31,8 +31,10 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.currentStatus.phase`,description="Current status of the machine." +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" -// Machine TODO +// Machine is the representation of a physical or virtual machine. type Machine struct { // ObjectMeta for machine object metav1.ObjectMeta `json:"metadata,omitempty"` @@ -81,6 +83,7 @@ type ClassSpec struct { // NodeTemplateSpec describes the data a node should have when created from a template type NodeTemplateSpec struct { + // +kubebuilder:validation:XPreserveUnknownFields // +optional metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/machine/v1alpha1/machineclass_types.go b/pkg/apis/machine/v1alpha1/machineclass_types.go index 905835ad7..3682ab812 100644 --- a/pkg/apis/machine/v1alpha1/machineclass_types.go +++ b/pkg/apis/machine/v1alpha1/machineclass_types.go @@ -37,6 +37,7 @@ type MachineClass struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XPreserveUnknownFields // Provider-specific configuration to use during node creation. ProviderSpec runtime.RawExtension `json:"providerSpec"` // SecretRef stores the necessary secrets such as credentials or userdata. diff --git a/pkg/apis/machine/v1alpha1/shared_types.go b/pkg/apis/machine/v1alpha1/shared_types.go index d1d56f6ab..c5737c45b 100644 --- a/pkg/apis/machine/v1alpha1/shared_types.go +++ b/pkg/apis/machine/v1alpha1/shared_types.go @@ -24,6 +24,7 @@ import ( // MachineTemplateSpec describes the data a machine should have when created from a template type MachineTemplateSpec struct { + // +kubebuilder:validation:XPreserveUnknownFields // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata // +optional diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index 125b1d120..e34d4e795 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -2309,7 +2309,7 @@ func schema_pkg_apis_machine_v1alpha1_Machine(ref common.ReferenceCallback) comm return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Machine TODO", + Description: "Machine is the representation of a physical or virtual machine.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "metadata": {