Skip to content
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

Merged
merged 1 commit into from
Oct 14, 2019
Merged

Conversation

georgekuruvillak
Copy link

This PR creates unit tests for testing whether reconciliation occurs and it creates the resources mentioned in the charts.

@georgekuruvillak georgekuruvillak requested a review from a team as a code owner September 27, 2019 08:19
Copy link
Collaborator

@amshuman-kr amshuman-kr left a 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.

config/crd/bases/druid.sapcloud.io_etcds.yaml Show resolved Hide resolved
controllers/etcd_controller_test.go Show resolved Hide resolved
controllers/suite_test.go Show resolved Hide resolved
Copy link

@ggaurav10 ggaurav10 left a 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?

api/v1/zz_generated.deepcopy.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@amshuman-kr amshuman-kr left a 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) {
Copy link
Collaborator

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?

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.

Copy link
Collaborator

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?

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.

Copy link
Collaborator

@amshuman-kr amshuman-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants