feat: --no-install flag for 'machine init/add' to skip installing Uncloud daemon and dependencies #122

This commit is contained in:
Pasha Sviderski
2025-09-15 20:44:35 +10:00
parent b6e9766f40
commit f8fe3c7af3
3 changed files with 38 additions and 18 deletions
+13 -6
View File
@@ -20,12 +20,13 @@ import (
)
type addOptions struct {
name string
noCaddy bool
publicIP string
sshKey string
context string
version string
name string
noCaddy bool
noInstall bool
publicIP string
sshKey string
context string
version string
}
func NewAddCommand() *cobra.Command {
@@ -56,6 +57,11 @@ func NewAddCommand() *cobra.Command {
&opts.noCaddy, "no-caddy", false,
"Don't deploy Caddy reverse proxy service to the machine.",
)
cmd.Flags().BoolVar(
&opts.noInstall, "no-install", false,
"Skip installation of Docker, Uncloud daemon, and dependencies on the machine. "+
"Assumes they're already installed and running.",
)
cmd.Flags().StringVar(
&opts.publicIP, "public-ip", "auto",
"Public IP address of the machine for ingress configuration. Use 'auto' for automatic detection, "+
@@ -98,6 +104,7 @@ func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine,
MachineName: opts.name,
PublicIP: publicIP,
RemoteMachine: remoteMachine,
SkipInstall: opts.noInstall,
Version: opts.version,
})
if err != nil {
+7
View File
@@ -22,6 +22,7 @@ type initOptions struct {
network string
noCaddy bool
noDNS bool
noInstall bool
publicIP string
sshKey string
version string
@@ -74,6 +75,11 @@ func NewInitCommand() *cobra.Command {
&opts.noDNS, "no-dns", false,
"Don't reserve a cluster domain in Uncloud DNS.",
)
cmd.Flags().BoolVar(
&opts.noInstall, "no-install", false,
"Skip installation of Docker, Uncloud daemon, and dependencies on the machine. "+
"Assumes they're already installed and running.",
)
cmd.Flags().StringVar(
&opts.publicIP, "public-ip", "auto",
"Public IP address of the machine for ingress configuration. Use 'auto' for automatic detection, "+
@@ -121,6 +127,7 @@ func initCluster(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteM
Network: netPrefix,
PublicIP: publicIP,
RemoteMachine: remoteMachine,
SkipInstall: opts.noInstall,
Version: opts.version,
})
if err != nil {