Skip to content

Commit 9f2a37c

Browse files
committed
test: deprecated status structure
1 parent d290d64 commit 9f2a37c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/infrastructure/docker/internal/controllers/backends/inmemory/inmemorymachine_controller_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,32 @@ var (
7575
)
7676

7777
func updateNodeProvisionedTime(machine *infrav1.DevMachine) {
78+
klog.Infof("DEBUG: machineName: %s", machine.Name)
79+
80+
// current status structure
7881
for i := range machine.Status.Conditions {
82+
klog.Infof("DEBUG: current status structure, found %d conditions", len(machine.Status.Conditions))
7983
if machine.Status.Conditions[i].Type == string(infrav1.NodeProvisionedCondition) {
84+
klog.Infof("DEBUG: NodeProvisionedCondition in current status structure, updating LastTransitionTime")
8085
machine.Status.Conditions[i].LastTransitionTime = metav1.Now()
81-
break
86+
return
8287
}
8388
}
89+
90+
// deprecated status structure
91+
if machine.Status.Deprecated != nil && machine.Status.Deprecated.V1Beta1 != nil {
92+
klog.Infof("DEBUG: deprecated status structure, found %d conditions", len(machine.Status.Deprecated.V1Beta1.Conditions))
93+
for i := range machine.Status.Deprecated.V1Beta1.Conditions {
94+
klog.Infof("DEBUG: Checking condition type: %s", machine.Status.Deprecated.V1Beta1.Conditions[i].Type)
95+
if machine.Status.Deprecated.V1Beta1.Conditions[i].Type == infrav1.NodeProvisionedCondition {
96+
klog.Infof("DEBUG: NodeProvisionedCondition in deprecated status structure, updating LastTransitionTime")
97+
machine.Status.Deprecated.V1Beta1.Conditions[i].LastTransitionTime = metav1.Now()
98+
return
99+
}
100+
}
101+
}
102+
103+
klog.Infof("DEBUG: NodeProvisionedCondition not found in status structure for machine %s", machine.Name)
84104
}
85105

86106
func init() {

0 commit comments

Comments
 (0)