From 6fb6f2e68150ff168b8094ce925e03725d4ae810 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Wed, 26 Jun 2019 12:44:07 -0700 Subject: [PATCH] Remove Conditions and Addresses from Machine.Status Signed-off-by: Vince Prignano --- config/crds/cluster.sigs.k8s.io_machines.yaml | 52 ------------------- pkg/apis/cluster/v1alpha2/machine_types.go | 12 ----- .../cluster/v1alpha2/zz_generated.deepcopy.go | 12 ----- pkg/controller/machine/BUILD.bazel | 5 +- 4 files changed, 4 insertions(+), 77 deletions(-) diff --git a/config/crds/cluster.sigs.k8s.io_machines.yaml b/config/crds/cluster.sigs.k8s.io_machines.yaml index d52320fd2b63..67ea07e6e37c 100644 --- a/config/crds/cluster.sigs.k8s.io_machines.yaml +++ b/config/crds/cluster.sigs.k8s.io_machines.yaml @@ -573,61 +573,9 @@ spec: type: object status: properties: - addresses: - description: Addresses is a list of addresses assigned to the machine. - Queried from cloud provider, if available. - items: - properties: - address: - description: The node address. - type: string - type: - description: Node address type, one of Hostname, ExternalIP or - InternalIP. - type: string - required: - - type - - address - type: object - type: array bootstrap: description: Bootstrap is the state of the bootstrap provider. type: string - conditions: - description: 'Conditions lists the conditions synced from the node conditions - of the corresponding node-object. Machine-controller is responsible - for keeping conditions up-to-date. MachineSet controller will be taking - these conditions as a signal to decide if machine is healthy or needs - to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' - items: - properties: - lastHeartbeatTime: - description: Last time we got an update on a given condition. - format: date-time - type: string - lastTransitionTime: - description: Last time the condition transit from one status to - another. - format: date-time - type: string - message: - description: Human readable message indicating details about last - transition. - type: string - reason: - description: (brief) reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of node condition. - type: string - required: - - type - - status - type: object - type: array errorMessage: description: "ErrorMessage will be set in the event that there is a terminal problem reconciling the Machine and will contain a more verbose diff --git a/pkg/apis/cluster/v1alpha2/machine_types.go b/pkg/apis/cluster/v1alpha2/machine_types.go index d3541b6951fb..a97c208bd6aa 100644 --- a/pkg/apis/cluster/v1alpha2/machine_types.go +++ b/pkg/apis/cluster/v1alpha2/machine_types.go @@ -146,18 +146,6 @@ type MachineStatus struct { // +optional ErrorMessage *string `json:"errorMessage,omitempty"` - // Addresses is a list of addresses assigned to the machine. Queried from cloud provider, if available. - // +optional - Addresses []corev1.NodeAddress `json:"addresses,omitempty"` - - // Conditions lists the conditions synced from the node conditions of the corresponding node-object. - // Machine-controller is responsible for keeping conditions up-to-date. - // MachineSet controller will be taking these conditions as a signal to decide if - // machine is healthy or needs to be replaced. - // Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition - // +optional - Conditions []corev1.NodeCondition `json:"conditions,omitempty"` - // Phase represents the current phase of machine actuation. // E.g. Pending, Running, Terminating, Failed etc. // +optional diff --git a/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go index dd47b9a40492..0bc2915323db 100644 --- a/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go @@ -591,18 +591,6 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { *out = new(string) **out = **in } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]v1.NodeAddress, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.NodeCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } if in.Phase != nil { in, out := &in.Phase, &out.Phase *out = new(string) diff --git a/pkg/controller/machine/BUILD.bazel b/pkg/controller/machine/BUILD.bazel index f8a4cdf65876..0208ee1ba033 100644 --- a/pkg/controller/machine/BUILD.bazel +++ b/pkg/controller/machine/BUILD.bazel @@ -2,7 +2,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["machine_controller.go"], + srcs = [ + "machine_controller.go", + "machine_controller_phases.go", + ], importpath = "sigs.k8s.io/cluster-api/pkg/controller/machine", visibility = ["//visibility:public"], deps = [