-
Notifications
You must be signed in to change notification settings - Fork 49
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
Added unit tests. #1
Conversation
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.
Suggested some minor code refactoring below.
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.
The headers in some files is 2018. Should we make it 2019 across?
88c3e72
to
fe42fdb
Compare
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.
Do we need the finalizers? If we don't need them right now, then we can skip them now and introduce later only when we need them. WDYT?
LGTM otherwise.
} | ||
} | ||
if err := r.addFinalizersToDependantSecrets(etcdCopy); err != nil { | ||
if finalizers := sets.NewString(etcd.Finalizers...); !finalizers.Has(FinalizerName) { |
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.
Do we need the finalizers?
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. We need it. It's recommended that we have finazliers
on the resource being acted on. Basically without finalizer
is somebody deletes the secret, etcd-backup-restore pod will fail continuously.
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.
without finalizer is somebody deletes the secret, etcd-backup-restore pod will fail continuously.
This is true for the secrets. But the finalizer above is for the etcd
resource. Do we need that?
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. Cause its definitely react on etcd resource. If etcd resource is deleted, then it has to do cleanup job like bring down the etcd sts.
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.
LGTM
This PR creates unit tests for testing whether reconciliation occurs and it creates the resources mentioned in the charts.