add support for repo deleted event also
by having another interface RepositoryRemover that is implemented by registry instance and is injected in app context for event tracking Signed-off-by: Manish Tomar <manish.tomar@docker.com>
This commit is contained in:
parent
0d8f4ac7b8
commit
328069bb4d
7 changed files with 76 additions and 7 deletions
|
@ -124,6 +124,18 @@ func TestEventBridgeTagDeleted(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestEventBridgeRepoDeleted(t *testing.T) {
|
||||
l := createTestEnv(t, testSinkFn(func(events ...Event) error {
|
||||
checkDeleted(t, EventActionDelete, events...)
|
||||
return nil
|
||||
}))
|
||||
|
||||
repoRef, _ := reference.WithName(repo)
|
||||
if err := l.RepoDeleted(repoRef); err != nil {
|
||||
t.Fatalf("unexpected error notifying repo deletion: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func createTestEnv(t *testing.T, fn testSinkFn) Listener {
|
||||
pk, err := libtrust.GenerateECP256PrivateKey()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue