cloud/shepherd: skip machines in failed state
Currently we are not ignoring machines that are in failed state, which
brings the provider to a stop as soon as a provision request fails. We
should ignore such machines.
Change-Id: I7be64c710cc15428f4d8d4e75b6df1e816d453f8
Reviewed-on: https://review.monogon.dev/c/monogon/+/2417
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/shepherd/shepherd.go b/cloud/shepherd/shepherd.go
index 3504eb7..db5e75d 100644
--- a/cloud/shepherd/shepherd.go
+++ b/cloud/shepherd/shepherd.go
@@ -73,6 +73,10 @@
Addr() netip.Addr
// State returns the state in which the machine is
State() State
+ // Failed should return true if the machine is in a failed state and
+ // should be ignored if there are inconsistencies between the provider
+ // and BMDB.
+ Failed() bool
}
type CreateMachineRequest struct {