Closed Brett55 closed 7 years ago
Ah crap, you're right. I'll have to see what API I might have access to to check what organizations a user has any access to. In the meantime, I'll put in a PR to bypass the check as you're definitely right.
Thanks for quick response!
Apparently this should return what orgs a user belongs to: https://hub.docker.com/v2/user/orgs/
Looks like this will fix it...change https://github.com/docker/migrator/blob/master/migrator.sh#L431 to:
NAMESPACES=$(curl -sf -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/user/orgs/ | jq -r '.results|.[].orgname') || catch_error "curl => API failure"
@mbentley looks good, thanks for quick fix
When doing a GET on https://hub.docker.com/v2/repositories/namespaces it returns only namespaces in which members are owners, rather than read access. Thus causing this code block to raise an exception incorrectly
https://github.com/docker/migrator/blob/master/migrator.sh#L430-L436