Skip to content

Commit 66c01a7

Browse files
committed
chore: deprecate interactive installer mode
Removes `interactive` from `talosctl apply-config --mode interactive`, and deprecates related APIs. Signed-off-by: Laura Brehm <laurabrehm@hey.com>
1 parent 957770f commit 66c01a7

File tree

7 files changed

+34
-21
lines changed

7 files changed

+34
-21
lines changed

api/machine/machine.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ service MachineService {
6464
// EtcdDowngradeCancel cancels etcd cluster downgrade that is in progress.
6565
// This method is available only on control plane nodes (which run etcd).
6666
rpc EtcdDowngradeCancel(google.protobuf.Empty) returns (EtcdDowngradeCancelResponse);
67-
rpc GenerateConfiguration(GenerateConfigurationRequest) returns (GenerateConfigurationResponse);
67+
rpc GenerateConfiguration(GenerateConfigurationRequest) returns (GenerateConfigurationResponse) {
68+
option (common.remove_deprecated_method) = "v1.13";
69+
option deprecated = true;
70+
}
6871
rpc Hostname(google.protobuf.Empty) returns (HostnameResponse);
6972
rpc Kubeconfig(google.protobuf.Empty) returns (stream common.Data);
7073
rpc List(ListRequest) returns (stream FileInfo);

cmd/talosctl/cmd/talos/apply-config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var applyConfigCmd = &cobra.Command{
9090
return err
9191
}
9292
}
93-
} else if applyConfigCmdFlags.Mode.Mode != helpers.InteractiveMode {
93+
} else if applyConfigCmdFlags.Mode.Mode != helpers.InteractiveMode { //nolint:staticcheck
9494
return errors.New("no filename supplied for configuration")
9595
}
9696

@@ -103,7 +103,7 @@ var applyConfigCmd = &cobra.Command{
103103
}
104104

105105
return withClient(func(ctx context.Context, c *client.Client) error {
106-
if applyConfigCmdFlags.Mode.Mode == helpers.InteractiveMode {
106+
if applyConfigCmdFlags.Mode.Mode == helpers.InteractiveMode { //nolint:staticcheck
107107
install := installer.NewInstaller()
108108
node := GlobalArgs.Nodes[0]
109109

cmd/talosctl/pkg/talos/helpers/mode.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/siderolabs/gen/maps"
14+
"github.com/siderolabs/gen/xslices"
1415
"github.com/spf13/cobra"
1516

1617
"github.com/siderolabs/talos/pkg/cli"
@@ -19,6 +20,9 @@ import (
1920

2021
// InteractiveMode fake mode value for the interactive config mode.
2122
// Should be never passed to the API.
23+
//
24+
// Deprecated: Interactive configuration mode will be removed and
25+
// should no longer be used.
2226
const InteractiveMode machine.ApplyConfigurationRequest_Mode = -1
2327

2428
// Mode apply, patch, edit config update mode.
@@ -62,6 +66,9 @@ func (m *Mode) Set(value string) error {
6266
func (m *Mode) Type() string {
6367
options := maps.Keys(m.options)
6468
slices.Sort(options)
69+
options = xslices.Filter(options, func(opt string) bool {
70+
return opt != modeInteractive
71+
})
6572

6673
return strings.Join(options, ", ")
6774
}

pkg/machinery/api/machine/machine.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/machinery/api/machine/machine_grpc.pb.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/machinery/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func (c *Client) ApplyConfiguration(ctx context.Context, req *machineapi.ApplyCo
249249

250250
// GenerateConfiguration implements proto.MachineServiceClient interface.
251251
func (c *Client) GenerateConfiguration(ctx context.Context, req *machineapi.GenerateConfigurationRequest, callOptions ...grpc.CallOption) (resp *machineapi.GenerateConfigurationResponse, err error) {
252-
resp, err = c.MachineClient.GenerateConfiguration(ctx, req, callOptions...)
252+
resp, err = c.MachineClient.GenerateConfiguration(ctx, req, callOptions...) //nolint:staticcheck
253253

254254
return FilterMessages(resp, err)
255255
}

website/content/v1.12/reference/cli.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ talosctl apply-config [flags]
1616
### Options
1717

1818
```
19-
--cert-fingerprint strings list of server certificate fingeprints to accept (defaults to no check)
20-
-c, --cluster string Cluster to connect to if a proxy endpoint is used.
21-
-p, --config-patch stringArray the list of config patches to apply to the local config file before sending it to the node
22-
--context string Context to be used in command
23-
--dry-run check how the config change will be applied in dry-run mode
24-
-e, --endpoints strings override default endpoints in Talos configuration
25-
-f, --file string the filename of the updated configuration
26-
-h, --help help for apply-config
27-
-i, --insecure apply the config using the insecure (encrypted with no auth) maintenance service
28-
-m, --mode auto, interactive, no-reboot, reboot, staged, try apply config mode (default auto)
29-
-n, --nodes strings target the specified nodes
30-
--siderov1-keys-dir string The path to the SideroV1 auth PGP keys directory. Defaults to 'SIDEROV1_KEYS_DIR' env variable if set, otherwise '$HOME/.talos/keys'. Only valid for Contexts that use SideroV1 auth.
31-
--talosconfig string The path to the Talos configuration file. Defaults to 'TALOSCONFIG' env variable if set, otherwise '$HOME/.talos/config' and '/var/run/secrets/talos.dev/config' in order.
32-
--timeout duration the config will be rolled back after specified timeout (if try mode is selected) (default 1m0s)
19+
--cert-fingerprint strings list of server certificate fingeprints to accept (defaults to no check)
20+
-c, --cluster string Cluster to connect to if a proxy endpoint is used.
21+
-p, --config-patch stringArray the list of config patches to apply to the local config file before sending it to the node
22+
--context string Context to be used in command
23+
--dry-run check how the config change will be applied in dry-run mode
24+
-e, --endpoints strings override default endpoints in Talos configuration
25+
-f, --file string the filename of the updated configuration
26+
-h, --help help for apply-config
27+
-i, --insecure apply the config using the insecure (encrypted with no auth) maintenance service
28+
-m, --mode auto, no-reboot, reboot, staged, try apply config mode (default auto)
29+
-n, --nodes strings target the specified nodes
30+
--siderov1-keys-dir string The path to the SideroV1 auth PGP keys directory. Defaults to 'SIDEROV1_KEYS_DIR' env variable if set, otherwise '$HOME/.talos/keys'. Only valid for Contexts that use SideroV1 auth.
31+
--talosconfig string The path to the Talos configuration file. Defaults to 'TALOSCONFIG' env variable if set, otherwise '$HOME/.talos/config' and '/var/run/secrets/talos.dev/config' in order.
32+
--timeout duration the config will be rolled back after specified timeout (if try mode is selected) (default 1m0s)
3333
```
3434

3535
### SEE ALSO

0 commit comments

Comments
 (0)