Skip to content

Always return the source ip even if no limits#184

Merged
silvin-lubecki merged 1 commit intodocker:mainfrom
RomainBelorgey:sourceip
Sep 15, 2021
Merged

Always return the source ip even if no limits#184
silvin-lubecki merged 1 commit intodocker:mainfrom
RomainBelorgey:sourceip

Conversation

@RomainBelorgey
Copy link
Contributor

- What I did

If no limits, return the source ip and default values for the limits (-1).

Signed-off-by: Romain BELORGEY <romain.belorgey@gmail.com>
second = "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest"
first = "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull"
second = "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest"
defaultValue = -1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move this as a const?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks not possible to have a const:

# github.com/docker/hub-tool/pkg/hub pkg/hub/ratelimiting.go:77:21: cannot take the address of defaultValue pkg/hub/ratelimiting.go:78:21: cannot take the address of defaultValue pkg/hub/ratelimiting.go:79:21: cannot take the address of defaultValue pkg/hub/ratelimiting.go:80:21: cannot take the address of defaultValue 

😅 Is that fine to keep it like that ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right 🤦

@silvin-lubecki silvin-lubecki merged commit a01a01b into docker:main Sep 15, 2021
@RomainBelorgey RomainBelorgey deleted the sourceip branch September 15, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants