Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/getproviders/registry_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions internal/getproviders/registry_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down