Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/componetize the world #79

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
add --components flag to package deploy cmd
jeff-mccoy committed Oct 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9550e8dd39752b0f36d4a888fcd930a36673ff1b
2 changes: 1 addition & 1 deletion cli/cmd/initialize.go
Original file line number Diff line number Diff line change
@@ -71,5 +71,5 @@ func init() {
initCmd.Flags().StringVar(&initOptions.PKI.Host, "host", "", "Specify the host or IP for the utility cluster ingress. E.g. host=10.10.10.5 or host=utility.domain.com")
initCmd.Flags().StringVar(&initOptions.PKI.CertPublicPath, "server-crt", "", "Path to the server public key if not generating unique PKI")
initCmd.Flags().StringVar(&initOptions.PKI.CertPrivatePath, "server-key", "", "Path to the server private key if not generating unique PKI")
initCmd.Flags().StringVar(&initOptions.Components, "components", "", "Comma-separated list of components to install. Add this flag will also skip the init promps for which components to install")
initCmd.Flags().StringVar(&initOptions.Components, "components", "", "Comma-separated list of components to install. Adding this flag will skip the init prompts for which components to install")
}
4 changes: 3 additions & 1 deletion cli/cmd/package.go
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import (

var confirmCreate bool
var confirmDeploy bool
var deployComponents string

var packageCmd = &cobra.Command{
Use: "package",
@@ -31,7 +32,7 @@ var packageDeployCmd = &cobra.Command{
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
packageName := choosePackage(args)
packager.Deploy(packageName, confirmDeploy, "")
packager.Deploy(packageName, confirmDeploy, deployComponents)
},
}

@@ -69,4 +70,5 @@ func init() {

packageCreateCmd.Flags().BoolVar(&confirmCreate, "confirm", false, "Confirm package creation without prompting")
packageDeployCmd.Flags().BoolVar(&confirmDeploy, "confirm", false, "Confirm package deployment without prompting")
packageDeployCmd.Flags().StringVar(&deployComponents, "components", "", "Comma-separated list of components to install. Adding this flag will skip the init prompts for which components to install")
}
8 changes: 3 additions & 5 deletions cli/internal/k3s/install.go
Original file line number Diff line number Diff line change
@@ -11,13 +11,12 @@ import (
)

type InstallOptions struct {
PKI utils.PKIConfig
Confirmed bool
Components string
PKI utils.PKIConfig
Confirmed bool
Components string
}

func Install(options InstallOptions) {

utils.RunPreflightChecks()

logrus.Info("Installing K3s")
@@ -65,7 +64,6 @@ func createK3sSymlinks() {
}

func createService() {

servicePath := "/etc/systemd/system/k3s.service"

_ = os.Symlink(servicePath, "/etc/systemd/system/multi-user.target.wants/k3s.service")