Skip to content

Commit

Permalink
operator: stub etcd remove calls in env tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Oct 20, 2024
1 parent 583c1c5 commit 6e2f73a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -891,3 +891,11 @@ func (*unimplementedNodeReplacer) CreateNode(_ context.Context, _ string) (nodeN
func (*unimplementedNodeReplacer) DeleteNode(_ context.Context, _ string) error {
panic("unimplemented")
}

type stubEtcdRemover struct {
deleteErr error
}

func (r *stubEtcdRemover) RemoveEtcdMemberFromCluster(_ context.Context, _ string) error {
return r.deleteErr
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ var _ = BeforeSuite(func() {
err = (&NodeVersionReconciler{
kubernetesServerVersionGetter: fakes.k8sVerGetter,
nodeReplacer: fakes.nodeReplacer,
etcdRemover: fakes.etcdRemover,
Client: k8sManager.GetClient(),
Scheme: k8sManager.GetScheme(),
}).SetupWithManager(k8sManager)
Expand All @@ -147,6 +148,7 @@ type fakeCollection struct {
nodeStateGetter *stubNodeStateGetter
nodeReplacer *stubNodeReplacer
k8sVerGetter *stubKubernetesServerVersionGetter
etcdRemover *stubEtcdRemover
clock *testclock.FakeClock
}

Expand All @@ -162,6 +164,7 @@ func newFakes() fakeCollection {
nodeStateGetter: &stubNodeStateGetter{},
nodeReplacer: &stubNodeReplacer{},
k8sVerGetter: &stubKubernetesServerVersionGetter{},
etcdRemover: &stubEtcdRemover{},
clock: testclock.NewFakeClock(time.Now()),
}
}
Expand Down

0 comments on commit 6e2f73a

Please sign in to comment.