-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix installer tracetest dev docker warning and add options to run ins…
…taller directly without user input. (#2462) * Adding options to run installer with previously chosen options * Adding empty TRACETEST_DEV env when loading docker-compose on installation to avoid warning
- Loading branch information
1 parent
c133ffb
commit 5282b36
Showing
5 changed files
with
115 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package installer | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/pflag" | ||
) | ||
|
||
type RunEnvironmentType string | ||
|
||
var _ pflag.Value = (*RunEnvironmentType)(nil) | ||
|
||
const ( | ||
DockerRunEnvironmentType RunEnvironmentType = "docker" | ||
KubernetesRunEnvironmentType RunEnvironmentType = "kubernetes" | ||
NoneRunEnvironmentType RunEnvironmentType = "none" // stands for "no option chosen" | ||
) | ||
|
||
func (e *RunEnvironmentType) String() string { | ||
return string(*e) | ||
} | ||
|
||
func (e *RunEnvironmentType) Set(v string) error { | ||
switch v { | ||
case "docker", "kubernetes": | ||
*e = RunEnvironmentType(v) | ||
return nil | ||
default: | ||
return errors.New(`must be "docker" or "kubernetes"`) | ||
} | ||
} | ||
|
||
func (e *RunEnvironmentType) Type() string { | ||
return "(docker|kubernetes)" | ||
} | ||
|
||
type InstallationModeType string | ||
|
||
var _ pflag.Value = (*InstallationModeType)(nil) | ||
|
||
const ( | ||
WithDemoInstallationModeType InstallationModeType = "with-demo" | ||
WithoutDemoInstallationModeType InstallationModeType = "just-tracetest" | ||
NotChosenInstallationModeType InstallationModeType = "none" // stands for "no option chosen" | ||
) | ||
|
||
func (e *InstallationModeType) String() string { | ||
return string(*e) | ||
} | ||
|
||
func (e *InstallationModeType) Set(v string) error { | ||
switch v { | ||
case "with-demo", "just-tracetest": | ||
*e = InstallationModeType(v) | ||
return nil | ||
default: | ||
return errors.New(`must be "with-demo" or "just-tracetest"`) | ||
} | ||
} | ||
|
||
func (e *InstallationModeType) Type() string { | ||
return "(with-demo|just-tracetest)" | ||
} |