fix: tests

This commit is contained in:
Andre_Harms 2026-02-10 13:58:06 +01:00
parent b737875c68
commit 8a27483b81
4 changed files with 20 additions and 8 deletions

View file

@ -67,9 +67,11 @@ 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,
})
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)
@ -118,13 +120,13 @@ func CreateInstanceWaitHandler(
instanceCreated = true
instanceGetResponse = s
case InstanceStateSuccess:
if *s.Network.AccessScope == "SNA" {
if s.Network == nil || s.Network.InstanceAddress == nil {
if s.Network != nil && s.Network.AccessScope != nil && *s.Network.AccessScope == "SNA" {
if 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")
tflog.Warn(ctx, "Waiting for router_address")
return false, nil, nil
}
}