mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-23 07:00:40 +00:00
fix duplicate flag name
This commit is contained in:
parent
a49e7d7f18
commit
4ae4474734
@ -58,10 +58,10 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
|
|||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "version",
|
Name: "tofu-version",
|
||||||
Usage: "tofu version to use",
|
Usage: "tofu version to use",
|
||||||
EnvVars: []string{"PLUGIN_VERSION"},
|
EnvVars: []string{"PLUGIN_TOFU_VERSION"},
|
||||||
Destination: &settings.Version,
|
Destination: &settings.TofuVersion,
|
||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
|
@ -14,7 +14,7 @@ var (
|
|||||||
ErrTaintedPath = errors.New("filepath is tainted")
|
ErrTaintedPath = errors.New("filepath is tainted")
|
||||||
ErrMaxSizeSizeLimit = errors.New("max size limit of decoded data exceeded")
|
ErrMaxSizeSizeLimit = errors.New("max size limit of decoded data exceeded")
|
||||||
ErrActionUnknown = errors.New("action not found")
|
ErrActionUnknown = errors.New("action not found")
|
||||||
ErrInvalidVersion = errors.New("invalid version string")
|
ErrInvalidTofuVersion = errors.New("invalid version string")
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -47,8 +47,8 @@ func (p *Plugin) Validate() error {
|
|||||||
p.Settings.OutFile = fmt.Sprintf("%s.plan.tfout", p.Settings.DataDir)
|
p.Settings.OutFile = fmt.Sprintf("%s.plan.tfout", p.Settings.DataDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.Settings.Version != "" {
|
if p.Settings.TofuVersion != "" {
|
||||||
err := installPackage(p.Plugin.Network.Context, p.Plugin.Network.Client, p.Settings.Version, maxDecompressionSize)
|
err := installPackage(p.Plugin.Network.Context, p.Plugin.Network.Client, p.Settings.TofuVersion, maxDecompressionSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ type Plugin struct {
|
|||||||
type Settings struct {
|
type Settings struct {
|
||||||
Action cli.StringSlice
|
Action cli.StringSlice
|
||||||
|
|
||||||
Version string
|
TofuVersion string
|
||||||
InitOptions InitOptions
|
InitOptions InitOptions
|
||||||
FmtOptions FmtOptions
|
FmtOptions FmtOptions
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
func installPackage(ctx context.Context, client *http.Client, version string, maxSize int64) error {
|
func installPackage(ctx context.Context, client *http.Client, version string, maxSize int64) error {
|
||||||
// Sanitize user input
|
// Sanitize user input
|
||||||
if _, err := semver.NewVersion(version); err != nil {
|
if _, err := semver.NewVersion(version); err != nil {
|
||||||
return fmt.Errorf("%w: %v", ErrInvalidVersion, version)
|
return fmt.Errorf("%w: %v", ErrInvalidTofuVersion, version)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := downloadPackage(
|
err := downloadPackage(
|
||||||
|
Loading…
Reference in New Issue
Block a user