Skip to content

Commit

Permalink
Remove default value for Hardware.Spec.Metadata.State:
Browse files Browse the repository at this point in the history
This default value doesn't make sense from a holistic
point of view. It was added as part of some CAPT refactoring.
#669
If CAPT needs this state then the responsibility is on CAPT
to set this. Also, this field is no longer used by Smee or
CAPT.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Jul 1, 2024
1 parent 7647cbc commit 1f32358
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PROTOC_GEN_GO_GRPC := $(TOOLS_DIR)/protoc-gen-go-grpc
PROTOC_GEN_GO_VER := v1.28
PROTOC_GEN_GO := $(TOOLS_DIR)/protoc-gen-go

CONTROLLER_GEN_VER := v0.14
CONTROLLER_GEN_VER := v0.15
CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen-$(CONTROLLER_GEN_VER)

KUSTOMIZE_VER := v4.5
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/hardware_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ type IP struct {
}

type HardwareMetadata struct {
// +kubebuilder:default:=provisioning
State string `json:"state,omitempty"`
BondingMode int64 `json:"bonding_mode,omitempty"`
Manufacturer *MetadataManufacturer `json:"manufacturer,omitempty"`
Expand Down
17 changes: 13 additions & 4 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: hardware.tinkerbell.org
spec:
group: tinkerbell.org
Expand Down Expand Up @@ -343,7 +343,6 @@ spec:
type: string
type: object
state:
default: provisioning
type: string
type: object
resources:
Expand Down Expand Up @@ -416,10 +415,15 @@ spec:
description: BMCRef references a Rufio Machine object.
properties:
name:
default: ""
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
Expand Down Expand Up @@ -520,10 +524,15 @@ spec:
description: OSIE describes the Operating System Installation Environment to be netbooted.
properties:
name:
default: ""
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/tinkerbell.org_osies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: osies.tinkerbell.org
spec:
group: tinkerbell.org
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/tinkerbell.org_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: templates.tinkerbell.org
spec:
group: tinkerbell.org
Expand Down
16 changes: 13 additions & 3 deletions config/crd/bases/tinkerbell.org_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: workflows.tinkerbell.org
spec:
group: tinkerbell.org
Expand Down Expand Up @@ -180,10 +180,15 @@ spec:
description: HardwareRef is a reference to a Hardware resource this workflow will execute on.
properties:
name:
default: ""
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
Expand All @@ -201,10 +206,15 @@ spec:
description: TemplateRef is a reference to a Template resource used to render workflow actions.
properties:
name:
default: ""
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
type: object
x-kubernetes-map-type: atomic
Expand Down

0 comments on commit 1f32358

Please sign in to comment.