Commit 57812b2e authored by Paddy's avatar Paddy Committed by Paddy Carver
Browse files

Add support for protocol 6 providers during init. (#29153)

Update the version constraints for what providers will be downloaded
from the registry, allowing protocol 6 providers to be downloaded from
the registry.
No related merge requests found
Showing with 11 additions and 1 deletion
+11 -1
......@@ -55,7 +55,7 @@ func init() {
configureRequestTimeout()
}
var SupportedPluginProtocols = MustParseVersionConstraints("~> 5")
var SupportedPluginProtocols = MustParseVersionConstraints(">= 5, <7")
// registryClient is a client for the provider registry protocol that is
// specialized only for the needs of this package. It's not intended as a
......
......@@ -218,6 +218,10 @@ func fakeRegistryHandler(resp http.ResponseWriter, req *http.Request) {
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200)
resp.Write([]byte(`{"versions":[{"version":"1.0.0","protocols":["0.1"]}]}`))
case "weaksauce/protocol-six":
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200)
resp.Write([]byte(`{"versions":[{"version":"1.0.0","protocols":["6.0"]}]}`))
case "weaksauce/no-versions":
resp.Header().Set("Content-Type", "application/json")
resp.WriteHeader(200)
......@@ -412,6 +416,12 @@ func TestFindClosestProtocolCompatibleVersion(t *testing.T) {
versions.Unspecified,
``,
},
"provider protocol six": {
addrs.MustParseProviderSourceString("example.com/weaksauce/protocol-six"),
MustParseVersion("1.0.0"),
MustParseVersion("1.0.0"),
``,
},
}
for name, test := range tests {
t.Run(name, func(t *testing.T) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment