Emit ProviderAlreadyInstalled when provider installed
Emit the ProviderAlreadyInstalled event when we successfully verify that we've already installed this provider and are skipping installation
This commit is contained in:
parent
96be094ecd
commit
aa24bfec47
|
@ -314,6 +314,9 @@ NeedProvider:
|
|||
if installed := i.targetDir.ProviderVersion(provider, version); installed != nil {
|
||||
if len(preferredHashes) > 0 {
|
||||
if matches, _ := installed.MatchesAnyHash(preferredHashes); matches {
|
||||
if cb := evts.ProviderAlreadyInstalled; cb != nil {
|
||||
cb(provider, version)
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/apparentlymart/go-versions/versions"
|
||||
"github.com/apparentlymart/go-versions/versions/constraints"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
@ -646,6 +647,11 @@ func TestEnsureProviderVersions(t *testing.T) {
|
|||
Provider: beepProvider,
|
||||
Args: "2.0.0",
|
||||
},
|
||||
{
|
||||
Event: "ProviderAlreadyInstalled",
|
||||
Provider: beepProvider,
|
||||
Args: versions.Version{Major: 2, Minor: 0, Patch: 0},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue