diff --git a/client/api/omni/specs/infra.pb.go b/client/api/omni/specs/infra.pb.go index 8bf1c50e..fa539cf6 100644 --- a/client/api/omni/specs/infra.pb.go +++ b/client/api/omni/specs/infra.pb.go @@ -477,11 +477,12 @@ func (x *InfraMachineStateSpec) GetInstalled() bool { } type InfraMachineStatusSpec struct { - state protoimpl.MessageState `protogen:"open.v1"` - PowerState InfraMachineStatusSpec_MachinePowerState `protobuf:"varint,1,opt,name=power_state,json=powerState,proto3,enum=specs.InfraMachineStatusSpec_MachinePowerState" json:"power_state,omitempty"` - ReadyToUse bool `protobuf:"varint,2,opt,name=ready_to_use,json=readyToUse,proto3" json:"ready_to_use,omitempty"` - LastRebootId string `protobuf:"bytes,3,opt,name=last_reboot_id,json=lastRebootId,proto3" json:"last_reboot_id,omitempty"` - LastRebootTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_reboot_timestamp,json=lastRebootTimestamp,proto3" json:"last_reboot_timestamp,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + PowerState InfraMachineStatusSpec_MachinePowerState `protobuf:"varint,1,opt,name=power_state,json=powerState,proto3,enum=specs.InfraMachineStatusSpec_MachinePowerState" json:"power_state,omitempty"` + // ReadyToUse is set to true when the machine is not dirty, i.e., there is no pending wipe operation. + ReadyToUse bool `protobuf:"varint,2,opt,name=ready_to_use,json=readyToUse,proto3" json:"ready_to_use,omitempty"` + LastRebootId string `protobuf:"bytes,3,opt,name=last_reboot_id,json=lastRebootId,proto3" json:"last_reboot_id,omitempty"` + LastRebootTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_reboot_timestamp,json=lastRebootTimestamp,proto3" json:"last_reboot_timestamp,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } diff --git a/client/api/omni/specs/infra.proto b/client/api/omni/specs/infra.proto index 6e88e52d..bc6112ee 100644 --- a/client/api/omni/specs/infra.proto +++ b/client/api/omni/specs/infra.proto @@ -63,6 +63,8 @@ message InfraMachineStatusSpec { } MachinePowerState power_state = 1; + + // ReadyToUse is set to true when the machine is not dirty, i.e., there is no pending wipe operation. bool ready_to_use = 2; string last_reboot_id = 3; google.protobuf.Timestamp last_reboot_timestamp = 4; diff --git a/cmd/integration-test/pkg/tests/infra.go b/cmd/integration-test/pkg/tests/infra.go index 69ef0dc9..ab57be6e 100644 --- a/cmd/integration-test/pkg/tests/infra.go +++ b/cmd/integration-test/pkg/tests/infra.go @@ -299,10 +299,10 @@ func AssertInfraMachinesAreAllocated(testCtx context.Context, omniState state.St assertion.Equal(extensions, res.TypedSpec().Value.Extensions) }) - // The machine is allocated, so the ReadyToUse field is set to false + // The machine is allocated, so it will be powered on and be ready to use rtestutils.AssertResource[*infra.MachineStatus](ctx, t, omniState, id, func(res *infra.MachineStatus, assertion *assert.Assertions) { assertion.Equal(specs.InfraMachineStatusSpec_POWER_STATE_ON, res.TypedSpec().Value.PowerState) - assertion.False(res.TypedSpec().Value.ReadyToUse) + assertion.True(res.TypedSpec().Value.ReadyToUse) }) // Omni receives a SequenceEvent from the SideroLink event sink and sets the Installed field to true @@ -338,15 +338,15 @@ func AssertAllInfraMachinesAreUnallocated(testCtx context.Context, omniState sta } }) - // machine is unallocated, so the ReadyToUse field will be set to true - rtestutils.AssertResource[*infra.MachineStatus](ctx, t, omniState, id, func(res *infra.MachineStatus, assertion *assert.Assertions) { - assertion.True(res.TypedSpec().Value.ReadyToUse) - }) - // provider wipes the machine and sets the Installed field to false rtestutils.AssertResource[*infra.MachineState](ctx, t, omniState, id, func(res *infra.MachineState, assertion *assert.Assertions) { assertion.False(res.TypedSpec().Value.Installed) }) + + // after the machine is wiped, ReadyToUse field will be set to true + rtestutils.AssertResource[*infra.MachineStatus](ctx, t, omniState, id, func(res *infra.MachineStatus, assertion *assert.Assertions) { + assertion.True(res.TypedSpec().Value.ReadyToUse) + }) } } } diff --git a/internal/version/data/tag b/internal/version/data/tag index dc010256..5a863301 100644 --- a/internal/version/data/tag +++ b/internal/version/data/tag @@ -1 +1 @@ -v0.46.0-beta.0 +v0.46.0-beta.0 \ No newline at end of file