Skip to content

Commit a27f71c

Browse files
✨ Add nodeVolumeDetachTimeout property to Machine
1 parent fd11302 commit a27f71c

27 files changed

+273
-6
lines changed

api/v1alpha3/conversion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (src *Machine) ConvertTo(dstRaw conversion.Hub) error {
9898
}
9999

100100
dst.Spec.NodeDeletionTimeout = restored.Spec.NodeDeletionTimeout
101+
dst.Spec.NodeVolumeDetachTimeout = restored.Spec.NodeVolumeDetachTimeout
101102
dst.Status.NodeInfo = restored.Status.NodeInfo
102103
dst.Status.CertificatesExpiryDate = restored.Status.CertificatesExpiryDate
103104
return nil
@@ -142,6 +143,7 @@ func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error {
142143
return err
143144
}
144145
dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout
146+
dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout
145147
dst.Status.Conditions = restored.Status.Conditions
146148
return nil
147149
}
@@ -196,6 +198,7 @@ func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error {
196198
}
197199

198200
dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout
201+
dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout
199202
dst.Status.Conditions = restored.Status.Conditions
200203
return nil
201204
}

api/v1alpha3/zz_generated.conversion.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha4/conversion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func (src *Machine) ConvertTo(dstRaw conversion.Hub) error {
160160

161161
dst.Spec.NodeDeletionTimeout = restored.Spec.NodeDeletionTimeout
162162
dst.Status.CertificatesExpiryDate = restored.Status.CertificatesExpiryDate
163+
dst.Spec.NodeVolumeDetachTimeout = restored.Spec.NodeVolumeDetachTimeout
163164
return nil
164165
}
165166

@@ -204,6 +205,7 @@ func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error {
204205
}
205206

206207
dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout
208+
dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout
207209
return nil
208210
}
209211

@@ -244,6 +246,7 @@ func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error {
244246
}
245247

246248
dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout
249+
dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout
247250
return nil
248251
}
249252

api/v1alpha4/zz_generated.conversion.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/machine_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const (
3333
// ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set.
3434
ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining"
3535

36+
// ExcludeWaitForNodeVolumeDetachAnnotation annotation explicitly skips the waiting for node volume detaching if set.
37+
ExcludeWaitForNodeVolumeDetachAnnotation = "machine.cluster.x-k8s.io/exclude-wait-for-node-volume-detach"
38+
3639
// MachineSetLabelName is the label set on machines if they're controlled by MachineSet.
3740
MachineSetLabelName = "cluster.x-k8s.io/set-name"
3841

@@ -103,6 +106,11 @@ type MachineSpec struct {
103106
// +optional
104107
NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"`
105108

109+
// NodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
110+
// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
111+
// +optional
112+
NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"`
113+
106114
// NodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
107115
// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
108116
// Defaults to 10 seconds.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.openapi.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_machinepools.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_machines.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)