adding prov check to solve false error of rc still provisioning
@@ -47,13 +47,20 @@ func (rc *AzureRedisCacheManager) Ensure(ctx context.Context, obj runtime.Object
if err != nil {
return false, err
}
- _, err = redisClient.Get(ctx, groupName, name)
+ resp, err := redisClient.Get(ctx, groupName, name)
if err == nil {
- instance.Status.Provisioning = false
- instance.Status.Provisioned = true
+ instance.Status.Message = "RedisCache exists but may not be ready"
+ instance.Status.State = resp.Status
+
+ if resp.ProvisioningState == "Succeeded" {
instance.Status.Message = resourcemanager.SuccessMsg
+ instance.Status.Provisioned = true
+ instance.Status.Provisioning = false
return true, nil
}
+
+ return false, nil
+ }
instance.Status.Message = fmt.Sprintf("RedisCache Get error %s", err.Error())
_, err = rc.CreateRedisCache(ctx, groupName, name, location, sku, enableNonSSLPort, nil)
