From d019a437790bea788bcba54ceae6f6323357ff6b Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 30 Jun 2023 11:01:06 -0400 Subject: [PATCH] Registry Index: multiple parameters with the same key are OR'ed together Specify that if a parameter is repeated (arch=amd64&arch=arm64), this is treated as OR. This matches the original Flagstate implementation, and is more useful than AND, since the result of such a query would always be empty. Based on changes from Stephan Bergmann ; see https://github.com/owtaylor/flagstate/pull/6 --- registry-index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/registry-index.md b/registry-index.md index 0016142..854de92 100644 --- a/registry-index.md +++ b/registry-index.md @@ -35,6 +35,15 @@ The following query parameters are understood: For parameters with `:exists` suffix, it is undefined what happens if any value other than `1` is specified. +Multiple parameters with the same key are OR'ed together: +An image *I* matches a given set of query parameters *S* iff: For each *K*=*V* +in *S*: either *K*=*V* matches S or there is another *K*=*V′* in *S* +with the same *K* and *K*=*V′* matches *S*. + +*Example*: `label:org.example.a:exists=1&label:org.example.b=X&label:org.example.b=Y` +matches images which have any `org.example.a` label, +and an `org.example.b` label with the value `X` or `Y`. + For requests to `/static`, Clients SHOULD sort their request parameters by the URL-encoded value of the `=` string. Python example: