Skip to content

Commit 96dc43f

Browse files
authored
[fix] restore pause handling during pivot (#1063)
* fix: restore pause handling during pivot * fix: bump Go toolchain to 1.25.9 * Add e2e test to assert cluster.spec.pause will set pause conditions on linode resource. Unpause as well when Cluster is unpaused. * fix: watch pause annotation updates
1 parent 9409614 commit 96dc43f

22 files changed

Lines changed: 1227 additions & 16 deletions

.github/filters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ kubeadm-flatcar:
2929
- templates/flavors/kubeadm/flatcar/*
3030
- e2e/capl-cluster-flavors/kubeadm-flatcar-vpcless-capl-cluster/*
3131

32+
cluster-pause:
33+
- e2e/cluster-pause/*
34+
3235
#k3s:
3336
# - templates/flavors/k3s/default/*
3437
# - e2e/capl-cluster-flavors/k3s-capl-cluster/*

.github/workflows/e2e-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
required: true
2525
options:
2626
- quick
27+
- cluster-pause
2728
- flavors
2829
- k3s
2930
- rke2

api/v1alpha2/linodecluster_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ type LinodeCluster struct {
123123
Status LinodeClusterStatus `json:"status,omitempty"`
124124
}
125125

126+
func (lc *LinodeCluster) GetConditions() []metav1.Condition {
127+
for i := range lc.Status.Conditions {
128+
if lc.Status.Conditions[i].Reason == "" {
129+
lc.Status.Conditions[i].Reason = DefaultConditionReason
130+
}
131+
}
132+
133+
return lc.Status.Conditions
134+
}
135+
136+
func (lc *LinodeCluster) SetConditions(conditions []metav1.Condition) {
137+
lc.Status.Conditions = conditions
138+
}
139+
126140
func (lc *LinodeCluster) SetCondition(cond metav1.Condition) {
127141
if cond.LastTransitionTime.IsZero() {
128142
cond.LastTransitionTime = metav1.Now()

api/v1alpha2/linodefirewall_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ type LinodeFirewall struct {
156156
Status LinodeFirewallStatus `json:"status,omitempty"`
157157
}
158158

159+
func (lfw *LinodeFirewall) GetConditions() []metav1.Condition {
160+
for i := range lfw.Status.Conditions {
161+
if lfw.Status.Conditions[i].Reason == "" {
162+
lfw.Status.Conditions[i].Reason = DefaultConditionReason
163+
}
164+
}
165+
166+
return lfw.Status.Conditions
167+
}
168+
169+
func (lfw *LinodeFirewall) SetConditions(conditions []metav1.Condition) {
170+
lfw.Status.Conditions = conditions
171+
}
172+
159173
func (lfw *LinodeFirewall) SetCondition(cond metav1.Condition) {
160174
if cond.LastTransitionTime.IsZero() {
161175
cond.LastTransitionTime = metav1.Now()

api/v1alpha2/linodemachine_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,20 @@ type LinodeMachine struct {
610610
Status LinodeMachineStatus `json:"status,omitempty"`
611611
}
612612

613+
func (lm *LinodeMachine) GetConditions() []metav1.Condition {
614+
for i := range lm.Status.Conditions {
615+
if lm.Status.Conditions[i].Reason == "" {
616+
lm.Status.Conditions[i].Reason = DefaultConditionReason
617+
}
618+
}
619+
620+
return lm.Status.Conditions
621+
}
622+
623+
func (lm *LinodeMachine) SetConditions(conditions []metav1.Condition) {
624+
lm.Status.Conditions = conditions
625+
}
626+
613627
func (lm *LinodeMachine) SetCondition(cond metav1.Condition) {
614628
if cond.LastTransitionTime.IsZero() {
615629
cond.LastTransitionTime = metav1.Now()

api/v1alpha2/linodeplacementgroup_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,20 @@ type LinodePlacementGroup struct {
135135
Status LinodePlacementGroupStatus `json:"status,omitempty"`
136136
}
137137

138+
func (lpg *LinodePlacementGroup) GetConditions() []metav1.Condition {
139+
for i := range lpg.Status.Conditions {
140+
if lpg.Status.Conditions[i].Reason == "" {
141+
lpg.Status.Conditions[i].Reason = DefaultConditionReason
142+
}
143+
}
144+
145+
return lpg.Status.Conditions
146+
}
147+
148+
func (lpg *LinodePlacementGroup) SetConditions(conditions []metav1.Condition) {
149+
lpg.Status.Conditions = conditions
150+
}
151+
138152
func (lpg *LinodePlacementGroup) SetCondition(cond metav1.Condition) {
139153
if cond.LastTransitionTime.IsZero() {
140154
cond.LastTransitionTime = metav1.Now()

api/v1alpha2/linodevpc_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,20 @@ type LinodeVPC struct {
217217
Status LinodeVPCStatus `json:"status,omitempty"`
218218
}
219219

220+
func (lv *LinodeVPC) GetConditions() []metav1.Condition {
221+
for i := range lv.Status.Conditions {
222+
if lv.Status.Conditions[i].Reason == "" {
223+
lv.Status.Conditions[i].Reason = DefaultConditionReason
224+
}
225+
}
226+
227+
return lv.Status.Conditions
228+
}
229+
230+
func (lv *LinodeVPC) SetConditions(conditions []metav1.Condition) {
231+
lv.Status.Conditions = conditions
232+
}
233+
220234
func (lv *LinodeVPC) SetCondition(cond metav1.Condition) {
221235
if cond.LastTransitionTime.IsZero() {
222236
cond.LastTransitionTime = metav1.Now()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: capi-controller-manager
5+
namespace: capi-system
6+
status:
7+
availableReplicas: 1
8+
---
9+
apiVersion: apps/v1
10+
kind: Deployment
11+
metadata:
12+
name: capl-controller-manager
13+
namespace: capl-system
14+
status:
15+
availableReplicas: 1
16+
---
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
name: capi-kubeadm-bootstrap-controller-manager
21+
namespace: capi-kubeadm-bootstrap-system
22+
status:
23+
availableReplicas: 1
24+
---
25+
apiVersion: apps/v1
26+
kind: Deployment
27+
metadata:
28+
name: capi-kubeadm-control-plane-controller-manager
29+
namespace: capi-kubeadm-control-plane-system
30+
status:
31+
availableReplicas: 1
32+
---
33+
apiVersion: apps/v1
34+
kind: Deployment
35+
metadata:
36+
name: caaph-controller-manager
37+
namespace: caaph-system
38+
status:
39+
availableReplicas: 1
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: ccm-linode
5+
namespace: kube-system
6+
status:
7+
currentNumberScheduled: 1
8+
desiredNumberScheduled: 1
9+
numberAvailable: 1
10+
numberMisscheduled: 0
11+
numberReady: 1
12+
---
13+
apiVersion: apps/v1
14+
kind: DaemonSet
15+
metadata:
16+
name: cilium
17+
namespace: kube-system
18+
status:
19+
currentNumberScheduled: 2
20+
desiredNumberScheduled: 2
21+
numberAvailable: 2
22+
numberMisscheduled: 0
23+
numberReady: 2
24+
---
25+
apiVersion: apps/v1
26+
kind: DaemonSet
27+
metadata:
28+
name: csi-linode-node
29+
namespace: kube-system
30+
status:
31+
currentNumberScheduled: 2
32+
desiredNumberScheduled: 2
33+
numberAvailable: 2
34+
numberMisscheduled: 0
35+
numberReady: 2
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: cilium-operator
5+
namespace: kube-system
6+
status:
7+
availableReplicas: 2
8+
readyReplicas: 2
9+
---
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
metadata:
13+
labels:
14+
app.kubernetes.io/part-of: cilium
15+
namespace: kube-system
16+
status:
17+
readyReplicas: 1
18+
---
19+
apiVersion: apps/v1
20+
kind: Deployment
21+
metadata:
22+
name: coredns
23+
namespace: kube-system
24+
status:
25+
availableReplicas: 2
26+
readyReplicas: 2

0 commit comments

Comments
 (0)