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

feat: add custom config support to talosctl cluster create #8333

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cmd/talosctl/cmd/mgmt/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,17 @@ func create(ctx context.Context, flags *pflag.FlagSet) error {
return err
}

bundleTalosconfig := configBundle.TalosConfig()
if bundleTalosconfig == nil {
if clusterWait {
return errors.New("no talosconfig in the config bundle: cannot wait for cluster")
}

if applyConfigEnabled {
return errors.New("no talosconfig in the config bundle: cannot apply config")
}
}

if skipInjectingConfig {
types := []machine.Type{machine.TypeControlPlane, machine.TypeWorker}

Expand Down Expand Up @@ -827,8 +838,13 @@ func create(ctx context.Context, flags *pflag.FlagSet) error {
return err
}

// No talosconfig in the bundle - skip the operations below
if bundleTalosconfig == nil {
return nil
}

// Create and save the talosctl configuration file.
if err = saveConfig(configBundle.TalosConfig()); err != nil {
if err = saveConfig(bundleTalosconfig); err != nil {
return err
}

Expand Down