mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 07:15:05 -04:00
Simplify node lock and various small changes
Co-authored-by: Fabian Kammel <fabian@kammel.dev> Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com>
This commit is contained in:
parent
2bcf001d52
commit
cce2611e2a
31 changed files with 530 additions and 229 deletions
|
@ -124,6 +124,7 @@ func TestInit(t *testing.T) {
|
|||
fileHandler: tc.fileHandler,
|
||||
logger: zaptest.NewLogger(t),
|
||||
grpcServer: serveStopper,
|
||||
cleaner: &fakeCleaner{serveStopper: serveStopper},
|
||||
}
|
||||
|
||||
kubeconfig, err := server.Init(context.Background(), tc.req)
|
||||
|
@ -253,3 +254,11 @@ func newFakeLock() *fakeLock {
|
|||
func (l *fakeLock) TryLockOnce(_, _ []byte) (bool, error) {
|
||||
return l.state.TryLock(), nil
|
||||
}
|
||||
|
||||
type fakeCleaner struct {
|
||||
serveStopper
|
||||
}
|
||||
|
||||
func (f *fakeCleaner) Clean() {
|
||||
go f.serveStopper.GracefulStop() // this is not the correct way to do this, but it's fine for testing
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue