Skip to content

Not working anymore with docker registry 2 ? #11

@kheraud

Description

@kheraud

I see exceptions raised by docker-hook for every single action I do with my registry.

Exception happened during processing of request from ('127.0.0.1', 41065)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/usr/local/bin/docker-hook", line 40, in do_POST
    for var, val in json_params['repository'].items())
KeyError: 'repository'

This issue comes from the fact that docker-hook expects the POSTed Json to contain a single event. Digging in the code, it seems that nothing is built to handle "grouped" events ({events: [...]})

Docker doc for registry notifications states:

While events may be sent in the same envelope, the set of events within that envelope have no implied relationship. For example, the registry may choose to group unrelated events and send them in the same envelope to reduce the total number of requests.

I am wondering if the script is made to be used with docker registry 2 (private registry) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions