mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Check node length to match expected node count
This commit is contained in:
parent
8a4cbcb5a2
commit
c95557af27
@ -337,6 +337,11 @@ func CacheClusterStateRefreshFunc(conn *elasticache.ElastiCache, clusterID, give
|
||||
|
||||
// return given state if it's not in pending
|
||||
if givenState != "" {
|
||||
// check to make sure we have the node count we're expecting
|
||||
if int64(len(c.CacheNodes)) != *c.NumCacheNodes {
|
||||
log.Printf("[DEBUG] Node count is not what is expected: %d found, %d expected", len(c.CacheNodes), *c.NumCacheNodes)
|
||||
return nil, "creating", nil
|
||||
}
|
||||
// loop the nodes and check their status as well
|
||||
for _, n := range c.CacheNodes {
|
||||
if n.CacheNodeStatus != nil && *n.CacheNodeStatus != "available" {
|
||||
|
Loading…
Reference in New Issue
Block a user