-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis replicationFactor/replicaNodes immutable #677
Conversation
if dataCentre.ReplicationFactor > 0 && dataCentre.NodesNumber == 0 { | ||
dataCentre.NodesNumber = dataCentre.MasterNodes * dataCentre.ReplicationFactor | ||
} else if dataCentre.NodesNumber > 0 && dataCentre.ReplicationFactor == 0 { | ||
dataCentre.ReplicationFactor = dataCentre.NodesNumber / dataCentre.MasterNodes | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the replication factor and nodes number are equal to 0, I assume that we create master nodes only, am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are
fmt.Println("DEFAULTER") | ||
fmt.Println("nodes number", dataCentre.NodesNumber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove it pls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -869,9 +869,22 @@ func (r *RedisReconciler) newWatchStatusJob(redis *v1beta1.Redis) scheduler.Job | |||
} | |||
} | |||
|
|||
if iRedis.Status.CurrentClusterOperationStatus == models.NoOperation && | |||
equals := redis.Spec.IsEqual(iRedis.Spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add this logic to the rest Kind
s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already fixed
99a3b4e
to
f270654
Compare
…for redis resource
This PR provides immutability for the
replicationFactor
andreplicaNodes
fields of the Redis data centre.Also, it provides automatical reconcile of external changes of the k8s resource spec equals to instaclustr resource spec.
closes #676