Remove unused FSRoot from NodeUp

This commit is contained in:
Ciprian Hacman 2020-08-12 15:32:45 +03:00
parent ec8bb515c9
commit d70fb506e5
3 changed files with 2 additions and 10 deletions

View File

@ -101,7 +101,6 @@ func main() {
i := bootstrap.Installation{ i := bootstrap.Installation{
CacheDir: flagCacheDir, CacheDir: flagCacheDir,
Command: command, Command: command,
FSRoot: flagRootFS,
} }
i.RunTasksOptions.InitDefaults() i.RunTasksOptions.InitDefaults()
i.RunTasksOptions.MaxTaskDuration = 5 * time.Minute i.RunTasksOptions.MaxTaskDuration = 5 * time.Minute
@ -115,7 +114,6 @@ func main() {
ConfigLocation: flagConf, ConfigLocation: flagConf,
Target: target, Target: target,
CacheDir: flagCacheDir, CacheDir: flagCacheDir,
FSRoot: flagRootFS,
} }
err = cmd.Run(os.Stdout) err = cmd.Run(os.Stdout)
if err == nil { if err == nil {

View File

@ -32,14 +32,13 @@ import (
) )
type Installation struct { type Installation struct {
FSRoot string
CacheDir string CacheDir string
RunTasksOptions fi.RunTasksOptions RunTasksOptions fi.RunTasksOptions
Command []string Command []string
} }
func (i *Installation) Run() error { func (i *Installation) Run() error {
_, err := distros.FindDistribution(i.FSRoot) _, err := distros.FindDistribution("/")
if err != nil { if err != nil {
return fmt.Errorf("error determining OS distribution: %v", err) return fmt.Errorf("error determining OS distribution: %v", err)
} }

View File

@ -56,7 +56,6 @@ const MaxTaskDuration = 365 * 24 * time.Hour
type NodeUpCommand struct { type NodeUpCommand struct {
CacheDir string CacheDir string
ConfigLocation string ConfigLocation string
FSRoot string
Target string Target string
cluster *api.Cluster cluster *api.Cluster
config *nodeup.Config config *nodeup.Config
@ -65,10 +64,6 @@ type NodeUpCommand struct {
// Run is responsible for perform the nodeup process // Run is responsible for perform the nodeup process
func (c *NodeUpCommand) Run(out io.Writer) error { func (c *NodeUpCommand) Run(out io.Writer) error {
if c.FSRoot == "" {
return fmt.Errorf("FSRoot is required")
}
if c.ConfigLocation != "" { if c.ConfigLocation != "" {
config, err := vfs.Context.ReadFile(c.ConfigLocation) config, err := vfs.Context.ReadFile(c.ConfigLocation)
if err != nil { if err != nil {
@ -162,7 +157,7 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
return fmt.Errorf("error determining OS architecture: %v", err) return fmt.Errorf("error determining OS architecture: %v", err)
} }
distribution, err := distros.FindDistribution(c.FSRoot) distribution, err := distros.FindDistribution("/")
if err != nil { if err != nil {
return fmt.Errorf("error determining OS distribution: %v", err) return fmt.Errorf("error determining OS distribution: %v", err)
} }