-
Notifications
You must be signed in to change notification settings - Fork 17
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
Initial implementation for the Reconcile Logic #17
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Gaurav Dasson <[email protected]>
@gdasson Thanks for the PR. Could you please resolve the comments and ensure the PR is in the best shape you think before marking it as ready for review and also remove "draft" from the title? I will take a second round of review once you mark it as ready for review. |
Signed-off-by: Gaurav Dasson <[email protected]>
Signed-off-by: Gaurav Dasson <[email protected]>
Signed-off-by: Gaurav Dasson <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gdasson The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
||
// Check if the size of the stateful set is less than expected size | ||
// Or if there is a pending learner to be promoted | ||
if *sts.Spec.Replicas < int32(etcdCluster.Spec.Size) && memberCnt > 0 { |
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 *sts.Spec.Replicas < int32(etcdCluster.Spec.Size) && memberCnt > 0 { | |
if *sts.Spec.Replicas < int32(etcdCluster.Spec.Size) { |
We should guarantee the following two conditions before performing the scale in & out:
sts.Spec.Replica == memberCnt (returned from etcd cluster)
is alwaystrue
. refer to https://github.com/ahrtr/etcd-operator/blob/f3b16f5e0b8e2751a1ddc35e0c6a8ccaf4afe568/controller.go#L302-L315sts.Spec.Replica >= 1
is always true
@hakman @justinsb @jmhbnz @ArkaSaha30 Please take a look at this PR. It will be the base for the following PRs. Thanks. cc @ivanvc Also I am most concerned about the e2e test as mentioned in #17 (comment) |
Signed-off-by: Gaurav Dasson <[email protected]>
@gdasson: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@gdasson please rebase this PR, thx |
} | ||
|
||
if etcdCluster.Spec.Size == 0 { | ||
logger.Info("EtcdCluster size is 0..Skipping next steps") |
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.
nit, a warning message might a little better. It is unusual to create a EtcdCluster with 0 member.
This PR is an intial implementation of the design mentioned here
The code is now in working state and able to create an etcd cluster. However, the code will continue to be refined and made more production ready as we review and incorporate feedback.