Skip to content

Commit

Permalink
Remove unused FSRoot from NodeUp
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciprian Hacman committed Aug 12, 2020
1 parent ec8bb51 commit d70fb50
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions cmd/nodeup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func main() {
i := bootstrap.Installation{
CacheDir: flagCacheDir,
Command: command,
FSRoot: flagRootFS,
}
i.RunTasksOptions.InitDefaults()
i.RunTasksOptions.MaxTaskDuration = 5 * time.Minute
Expand All @@ -115,7 +114,6 @@ func main() {
ConfigLocation: flagConf,
Target: target,
CacheDir: flagCacheDir,
FSRoot: flagRootFS,
}
err = cmd.Run(os.Stdout)
if err == nil {
Expand Down
3 changes: 1 addition & 2 deletions nodeup/pkg/bootstrap/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ import (
)

type Installation struct {
FSRoot string
CacheDir string
RunTasksOptions fi.RunTasksOptions
Command []string
}

func (i *Installation) Run() error {
_, err := distros.FindDistribution(i.FSRoot)
_, err := distros.FindDistribution("/")
if err != nil {
return fmt.Errorf("error determining OS distribution: %v", err)
}
Expand Down
7 changes: 1 addition & 6 deletions upup/pkg/fi/nodeup/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const MaxTaskDuration = 365 * 24 * time.Hour
type NodeUpCommand struct {
CacheDir string
ConfigLocation string
FSRoot string
Target string
cluster *api.Cluster
config *nodeup.Config
Expand All @@ -65,10 +64,6 @@ type NodeUpCommand struct {

// Run is responsible for perform the nodeup process
func (c *NodeUpCommand) Run(out io.Writer) error {
if c.FSRoot == "" {
return fmt.Errorf("FSRoot is required")
}

if c.ConfigLocation != "" {
config, err := vfs.Context.ReadFile(c.ConfigLocation)
if err != nil {
Expand Down Expand Up @@ -162,7 +157,7 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
return fmt.Errorf("error determining OS architecture: %v", err)
}

distribution, err := distros.FindDistribution(c.FSRoot)
distribution, err := distros.FindDistribution("/")
if err != nil {
return fmt.Errorf("error determining OS distribution: %v", err)
}
Expand Down

0 comments on commit d70fb50

Please sign in to comment.