chore: work save

This commit is contained in:
Marcel_Henselin 2026-01-29 10:05:13 +01:00
parent 3e3f13d36d
commit 9752d63f7e
19 changed files with 1003 additions and 209 deletions

View file

@ -67,6 +67,9 @@ func CreateInstanceWaitHandler(
if s == nil || s.Id == nil || *s.Id != instanceId || s.Status == nil {
return false, nil, nil
}
tflog.Debug(ctx, "waiting for instance ready", map[string]interface{}{
"status": *s.Status,
})
switch *s.Status {
default:
return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Status)
@ -92,17 +95,19 @@ func CreateInstanceWaitHandler(
if extendedTimeout < 3 {
maxWait = maxWait + time.Minute*5
extendedTimeout = extendedTimeout + 1
if s.Network == nil || s.Network.InstanceAddress == nil {
tflog.Warn(ctx, "Waiting for instance_address")
return false, nil, nil
}
if s.Network.RouterAddress == nil {
tflog.Warn(ctx, "Waiting for router_address")
return false, nil, nil
}
if s.Status == nil {
tflog.Warn(ctx, "Waiting for status")
return false, nil, nil
if *s.Network.AccessScope == "SNA" {
ready := true
if s.Network == nil || s.Network.InstanceAddress == nil {
tflog.Warn(ctx, "Waiting for instance_address")
ready = false
}
if s.Network.RouterAddress == nil {
tflog.Warn(ctx, "Waiting for router_address")
ready = false
}
if !ready {
return false, nil, nil
}
}
if s.IsDeletable == nil {
tflog.Warn(ctx, "Waiting for is_deletable")
@ -113,13 +118,15 @@ func CreateInstanceWaitHandler(
instanceCreated = true
instanceGetResponse = s
case InstanceStateSuccess:
if s.Network == nil || s.Network.InstanceAddress == nil {
tflog.Warn(ctx, "Waiting for instance_address")
return false, nil, nil
}
if s.Network.RouterAddress == nil {
tflog.Info(ctx, "Waiting for router_address")
return false, nil, nil
if *s.Network.AccessScope == "SNA" {
if s.Network == nil || s.Network.InstanceAddress == nil {
tflog.Warn(ctx, "Waiting for instance_address")
return false, nil, nil
}
if s.Network.RouterAddress == nil {
tflog.Info(ctx, "Waiting for router_address")
return false, nil, nil
}
}
instanceCreated = true
instanceGetResponse = s