-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor elemental-agent to use subcommands
Signed-off-by: Andrea Mazzotti <[email protected]>
- Loading branch information
1 parent
6cbed87
commit b9537ca
Showing
41 changed files
with
639 additions
and
1,433 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package agent | ||
|
||
import ( | ||
"github.com/rancher-sandbox/cluster-api-provider-elemental/internal/agent/log" | ||
"github.com/rancher-sandbox/cluster-api-provider-elemental/internal/agent/phase" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// installCmd represents the install command. | ||
var installCmd = &cobra.Command{ | ||
Use: "install", | ||
Short: "Installs the OS on this Elemental host", | ||
Long: "Installs the OS on this Elemental host", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
log.Info("Initializing agent") | ||
agentContext, err := InitAgent() | ||
if err != nil { | ||
log.Fatal(err, "Could not initialize agent") | ||
} | ||
|
||
log.Info("Installing host") | ||
installationHandler := phase.NewInstallHandler(*agentContext) | ||
installationHandler.Install() | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(installCmd) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.