mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
internal/getproviders: Include Provider and Version in PackageMeta
Although we tend to return these in contexts where at least one of these values is implied, being explicit means that PackageMeta values are self-contained and less reliant on such external context.
This commit is contained in:
parent
b53e3074cf
commit
3078d21c5f
@ -211,6 +211,8 @@ func (c *registryClient) PackageMeta(provider addrs.Provider, version Version, t
|
||||
}
|
||||
|
||||
ret := PackageMeta{
|
||||
Provider: provider,
|
||||
Version: version,
|
||||
ProtocolVersions: protoVersions,
|
||||
TargetPlatform: Platform{
|
||||
OS: body.OS,
|
||||
|
@ -117,6 +117,10 @@ func TestSourcePackageMeta(t *testing.T) {
|
||||
"1.2.0",
|
||||
"linux", "amd64",
|
||||
PackageMeta{
|
||||
Provider: addrs.NewProvider(
|
||||
svchost.Hostname("example.com"), "awesomesauce", "happycloud",
|
||||
),
|
||||
Version: versions.MustParseVersion("1.2.0"),
|
||||
ProtocolVersions: VersionList{versions.MustParseVersion("5.0.0")},
|
||||
TargetPlatform: Platform{"linux", "amd64"},
|
||||
Filename: "happycloud_1.2.0.zip",
|
||||
|
@ -48,6 +48,9 @@ var CurrentPlatform = Platform{
|
||||
// accepted by the current version of Terraform before trying to use the
|
||||
// described package.
|
||||
type PackageMeta struct {
|
||||
Provider addrs.Provider
|
||||
Version Version
|
||||
|
||||
ProtocolVersions VersionList
|
||||
TargetPlatform Platform
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user