command/init: Mention using the lock file for provider selection
This probably isn't the best UI we could do here, but it's a placeholder for now just to avoid making it seem like we're ignoring the lock file and checking for new versions anyway.
This commit is contained in:
parent
b3f5c7f1e6
commit
2611e08430
|
@ -494,12 +494,16 @@ func (c *InitCommand) getProviders(config *configs.Config, state *states.State,
|
|||
fmt.Sprintf("Cannot use %s: %s.", provider.ForDisplay(), err),
|
||||
))
|
||||
},
|
||||
QueryPackagesBegin: func(provider addrs.Provider, versionConstraints getproviders.VersionConstraints) {
|
||||
QueryPackagesBegin: func(provider addrs.Provider, versionConstraints getproviders.VersionConstraints, locked bool) {
|
||||
if locked {
|
||||
c.Ui.Info(fmt.Sprintf("- Reusing previous version of %s from the dependency lock file", provider.ForDisplay()))
|
||||
} else {
|
||||
if len(versionConstraints) > 0 {
|
||||
c.Ui.Info(fmt.Sprintf("- Finding %s versions matching %q...", provider.ForDisplay(), getproviders.VersionConstraintsString(versionConstraints)))
|
||||
} else {
|
||||
c.Ui.Info(fmt.Sprintf("- Finding latest version of %s...", provider.ForDisplay()))
|
||||
}
|
||||
}
|
||||
},
|
||||
LinkFromCacheBegin: func(provider addrs.Provider, version getproviders.Version, cacheRoot string) {
|
||||
c.Ui.Info(fmt.Sprintf("- Using %s v%s from the shared cache directory", provider.ForDisplay(), version))
|
||||
|
|
|
@ -211,7 +211,7 @@ func (i *Installer) EnsureProviderVersions(ctx context.Context, locks *depsfile.
|
|||
// this provider before we indicate that it failed using
|
||||
// QueryPackagesFailure.
|
||||
if cb := evts.QueryPackagesBegin; cb != nil {
|
||||
cb(provider, versionConstraints)
|
||||
cb(provider, versionConstraints, true)
|
||||
}
|
||||
if cb := evts.QueryPackagesFailure; cb != nil {
|
||||
cb(provider, err)
|
||||
|
@ -241,7 +241,7 @@ NeedProvider:
|
|||
}
|
||||
|
||||
if cb := evts.QueryPackagesBegin; cb != nil {
|
||||
cb(provider, reqs[provider])
|
||||
cb(provider, reqs[provider], locked[provider])
|
||||
}
|
||||
available, warnings, err := i.source.AvailableVersions(ctx, provider)
|
||||
if err != nil {
|
||||
|
|
|
@ -66,7 +66,7 @@ type InstallerEvents struct {
|
|||
// distinct provider.
|
||||
//
|
||||
// The Warning event is unique to the registry source
|
||||
QueryPackagesBegin func(provider addrs.Provider, versionConstraints getproviders.VersionConstraints)
|
||||
QueryPackagesBegin func(provider addrs.Provider, versionConstraints getproviders.VersionConstraints, locked bool)
|
||||
QueryPackagesSuccess func(provider addrs.Provider, selectedVersion getproviders.Version)
|
||||
QueryPackagesFailure func(provider addrs.Provider, err error)
|
||||
QueryPackagesWarning func(provider addrs.Provider, warn []string)
|
||||
|
|
Loading…
Reference in New Issue