Skip to content

Commit c57701d

Browse files
committed
fix: remove interactive installer
The interactive installer has been deprecated since v1.12 cycle, now removed completely including the API method. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 43937c1 commit c57701d

File tree

74 files changed

+1431
-3863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1431
-3863
lines changed

api/lock.binpb

32 Bytes
Binary file not shown.

api/machine/machine.proto

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ 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) {
68-
option (common.remove_deprecated_method) = "v1.13";
69-
option deprecated = true;
70-
}
7167
rpc Hostname(google.protobuf.Empty) returns (HostnameResponse);
7268
rpc Kubeconfig(google.protobuf.Empty) returns (stream common.Data);
7369
rpc List(ListRequest) returns (stream FileInfo);
@@ -1228,26 +1224,6 @@ message ClusterConfig {
12281224
bool allow_scheduling_on_control_planes = 4;
12291225
}
12301226

1231-
// GenerateConfigurationRequest describes a request to generate a new configuration
1232-
// on a node.
1233-
message GenerateConfigurationRequest {
1234-
string config_version = 1;
1235-
ClusterConfig cluster_config = 2;
1236-
MachineConfig machine_config = 3;
1237-
google.protobuf.Timestamp override_time = 4;
1238-
}
1239-
1240-
// GenerateConfiguration describes the response to a generate configuration request.
1241-
message GenerateConfiguration {
1242-
common.Metadata metadata = 1;
1243-
repeated bytes data = 2;
1244-
bytes talosconfig = 3;
1245-
}
1246-
1247-
message GenerateConfigurationResponse {
1248-
repeated GenerateConfiguration messages = 1;
1249-
}
1250-
12511227
message GenerateClientConfigurationRequest {
12521228
// Roles in the generated client certificate.
12531229
repeated string roles = 1;

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

Lines changed: 27 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"google.golang.org/protobuf/types/known/durationpb"
1717

1818
"github.com/siderolabs/talos/cmd/talosctl/pkg/talos/helpers"
19-
"github.com/siderolabs/talos/internal/pkg/tui/installer"
2019
machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine"
2120
"github.com/siderolabs/talos/pkg/machinery/client"
2221
"github.com/siderolabs/talos/pkg/machinery/config/configpatcher"
@@ -59,39 +58,39 @@ var applyConfigCmd = &cobra.Command{
5958
}
6059
}
6160

62-
if applyConfigCmdFlags.filename != "" {
63-
cfgBytes, err = os.ReadFile(applyConfigCmdFlags.filename)
61+
if applyConfigCmdFlags.filename == "" {
62+
return errors.New("no filename supplied for configuration")
63+
}
64+
65+
cfgBytes, err = os.ReadFile(applyConfigCmdFlags.filename)
66+
if err != nil {
67+
return fmt.Errorf("failed to read configuration from %q: %w", applyConfigCmdFlags.filename, err)
68+
}
69+
70+
if len(cfgBytes) < 1 {
71+
return errors.New("no configuration data read")
72+
}
73+
74+
if len(applyConfigCmdFlags.patches) != 0 {
75+
var (
76+
cfg configpatcher.Input
77+
patches []configpatcher.Patch
78+
)
79+
80+
patches, err = configpatcher.LoadPatches(applyConfigCmdFlags.patches)
6481
if err != nil {
65-
return fmt.Errorf("failed to read configuration from %q: %w", applyConfigCmdFlags.filename, err)
82+
return err
6683
}
6784

68-
if len(cfgBytes) < 1 {
69-
return errors.New("no configuration data read")
85+
cfg, err = configpatcher.Apply(configpatcher.WithBytes(cfgBytes), patches)
86+
if err != nil {
87+
return err
7088
}
7189

72-
if len(applyConfigCmdFlags.patches) != 0 {
73-
var (
74-
cfg configpatcher.Input
75-
patches []configpatcher.Patch
76-
)
77-
78-
patches, err = configpatcher.LoadPatches(applyConfigCmdFlags.patches)
79-
if err != nil {
80-
return err
81-
}
82-
83-
cfg, err = configpatcher.Apply(configpatcher.WithBytes(cfgBytes), patches)
84-
if err != nil {
85-
return err
86-
}
87-
88-
cfgBytes, err = cfg.Bytes()
89-
if err != nil {
90-
return err
91-
}
90+
cfgBytes, err = cfg.Bytes()
91+
if err != nil {
92+
return err
9293
}
93-
} else if applyConfigCmdFlags.Mode.Mode != helpers.InteractiveMode { //nolint:staticcheck
94-
return errors.New("no filename supplied for configuration")
9594
}
9695

9796
withClient := func(f func(context.Context, *client.Client) error) error {
@@ -103,44 +102,6 @@ var applyConfigCmd = &cobra.Command{
103102
}
104103

105104
return withClient(func(ctx context.Context, c *client.Client) error {
106-
if applyConfigCmdFlags.Mode.Mode == helpers.InteractiveMode { //nolint:staticcheck
107-
install := installer.NewInstaller()
108-
node := GlobalArgs.Nodes[0]
109-
110-
if len(GlobalArgs.Endpoints) > 0 {
111-
return WithClientNoNodes(func(bootstrapCtx context.Context, bootstrapClient *client.Client) error {
112-
opts := []installer.Option{
113-
installer.WithBootstrapNode(bootstrapCtx, bootstrapClient, GlobalArgs.Endpoints[0]),
114-
installer.WithDryRun(applyConfigCmdFlags.dryRun),
115-
}
116-
117-
conn, err := installer.NewConnection(
118-
ctx,
119-
c,
120-
node,
121-
opts...,
122-
)
123-
if err != nil {
124-
return err
125-
}
126-
127-
return install.Run(conn)
128-
})
129-
}
130-
131-
conn, err := installer.NewConnection(
132-
ctx,
133-
c,
134-
node,
135-
installer.WithDryRun(applyConfigCmdFlags.dryRun),
136-
)
137-
if err != nil {
138-
return err
139-
}
140-
141-
return install.Run(conn)
142-
}
143-
144105
resp, err := c.ApplyConfiguration(ctx, &machineapi.ApplyConfigurationRequest{
145106
Data: cfgBytes,
146107
Mode: applyConfigCmdFlags.Mode.Mode,

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

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,12 @@ import (
1111
"strings"
1212

1313
"github.com/siderolabs/gen/maps"
14-
"github.com/siderolabs/gen/xslices"
1514
"github.com/spf13/cobra"
1615

1716
"github.com/siderolabs/talos/pkg/cli"
1817
"github.com/siderolabs/talos/pkg/machinery/api/machine"
1918
)
2019

21-
// InteractiveMode fake mode value for the interactive config mode.
22-
// Should be never passed to the API.
23-
//
24-
// Deprecated: Interactive configuration mode will be removed and
25-
// should no longer be used.
26-
const InteractiveMode machine.ApplyConfigurationRequest_Mode = -1
27-
2820
// Mode apply, patch, edit config update mode.
2921
type Mode struct {
3022
options map[string]machine.ApplyConfigurationRequest_Mode
@@ -43,8 +35,6 @@ func (m Mode) String() string {
4335
return modeReboot
4436
case machine.ApplyConfigurationRequest_STAGED:
4537
return modeStaged
46-
case InteractiveMode:
47-
return modeInteractive
4838
default:
4939
return modeAuto
5040
}
@@ -66,20 +56,16 @@ func (m *Mode) Set(value string) error {
6656
func (m *Mode) Type() string {
6757
options := maps.Keys(m.options)
6858
slices.Sort(options)
69-
options = xslices.Filter(options, func(opt string) bool {
70-
return opt != modeInteractive
71-
})
7259

7360
return strings.Join(options, ", ")
7461
}
7562

7663
const (
77-
modeAuto = "auto"
78-
modeNoReboot = "no-reboot"
79-
modeReboot = "reboot"
80-
modeStaged = "staged"
81-
modeInteractive = "interactive"
82-
modeTry = "try"
64+
modeAuto = "auto"
65+
modeNoReboot = "no-reboot"
66+
modeReboot = "reboot"
67+
modeStaged = "staged"
68+
modeTry = "try"
8369
)
8470

8571
// AddModeFlags adds deprecated flags to the command and registers mode flag with it's parser.
@@ -92,10 +78,6 @@ func AddModeFlags(mode *Mode, command *cobra.Command) {
9278
modeTry: machine.ApplyConfigurationRequest_TRY,
9379
}
9480

95-
if command.Use == "apply-config" {
96-
modes[modeInteractive] = InteractiveMode
97-
}
98-
9981
mode.Mode = machine.ApplyConfigurationRequest_AUTO
10082
mode.options = modes
10183

hack/release.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ Users verifying reproducible images should use raw images, verify checksums, and
7777
title = "VM Hot-Add Support"
7878
description = """\
7979
Talos now includes udev rules to support hot-adding of CPUs in virtualized environments.
80+
"""
81+
82+
[notest.interactive-installer]
83+
title = "Interactive Installer Removal"
84+
description = """\
85+
The interactive installer mode has been removed from `talosctl apply-config` (`--mode=interactive`).
86+
It has been deprecated since Talos v1.12.0, and now fully removed.
87+
The related `GenerateConfiguration` API method has also been removed.
88+
Users are encouraged to use other installation methods, such as using pre-generated configuration files, or using Omni.
8089
"""
8190

8291
[make_deps]

internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import (
5757
"github.com/siderolabs/talos/internal/app/machined/pkg/system"
5858
"github.com/siderolabs/talos/internal/app/resources"
5959
storaged "github.com/siderolabs/talos/internal/app/storaged"
60-
"github.com/siderolabs/talos/internal/pkg/configuration"
6160
"github.com/siderolabs/talos/internal/pkg/containers"
6261
taloscontainerd "github.com/siderolabs/talos/internal/pkg/containers/containerd"
6362
"github.com/siderolabs/talos/internal/pkg/containers/cri"
@@ -330,15 +329,6 @@ func generateDiff(r runtime.Runtime, provider config.Provider) (string, error) {
330329
return "Config diff:\n\n" + documentsDiff, nil
331330
}
332331

333-
// GenerateConfiguration implements the machine.MachineServer interface.
334-
func (s *Server) GenerateConfiguration(ctx context.Context, in *machine.GenerateConfigurationRequest) (reply *machine.GenerateConfigurationResponse, err error) {
335-
if s.Controller.Runtime().Config().Machine().Type() == machinetype.TypeWorker {
336-
return nil, errors.New("config can't be generated on worker nodes")
337-
}
338-
339-
return configuration.Generate(ctx, s.Controller.Runtime().State().V1Alpha2().Resources(), in)
340-
}
341-
342332
// Reboot implements the machine.MachineServer interface.
343333
func (s *Server) Reboot(ctx context.Context, in *machine.RebootRequest) (reply *machine.RebootResponse, err error) {
344334
actorID := uuid.New().String()

internal/app/machined/pkg/system/services/machined.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ var rules = map[string]role.Set{
6262
"/machine.MachineService/EtcdDowngradeValidate": role.MakeSet(role.Admin),
6363
"/machine.MachineService/Events": role.MakeSet(role.Admin, role.Operator, role.Reader),
6464
"/machine.MachineService/GenerateClientConfiguration": role.MakeSet(role.Admin),
65-
"/machine.MachineService/GenerateConfiguration": role.MakeSet(role.Admin),
6665
"/machine.MachineService/Hostname": role.MakeSet(role.Admin, role.Operator, role.Reader),
6766
"/machine.MachineService/ImageList": role.MakeSet(role.Admin, role.Operator, role.Reader),
6867
"/machine.MachineService/ImagePull": role.MakeSet(role.Admin, role.Operator),

internal/app/maintenance/server.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ import (
2626
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
2727
"github.com/siderolabs/talos/internal/app/resources"
2828
storaged "github.com/siderolabs/talos/internal/app/storaged"
29-
"github.com/siderolabs/talos/internal/pkg/configuration"
3029
"github.com/siderolabs/talos/pkg/grpc/middleware/authz"
3130
"github.com/siderolabs/talos/pkg/machinery/api/machine"
3231
"github.com/siderolabs/talos/pkg/machinery/api/storage"
3332
"github.com/siderolabs/talos/pkg/machinery/config"
3433
"github.com/siderolabs/talos/pkg/machinery/config/configloader"
35-
v1alpha1machine "github.com/siderolabs/talos/pkg/machinery/config/machine"
3634
blockres "github.com/siderolabs/talos/pkg/machinery/resources/block"
3735
"github.com/siderolabs/talos/pkg/machinery/role"
3836
"github.com/siderolabs/talos/pkg/machinery/version"
@@ -133,25 +131,6 @@ Node is running in maintenance mode and does not have a config yet.`
133131
return reply, nil
134132
}
135133

136-
// GenerateConfiguration implements the [machine.MachineServiceServer] interface.
137-
func (s *Server) GenerateConfiguration(ctx context.Context, in *machine.GenerateConfigurationRequest) (*machine.GenerateConfigurationResponse, error) {
138-
if s.mode.IsAgent() {
139-
return nil, status.Error(codes.Unimplemented, "API is not implemented in agent mode")
140-
}
141-
142-
if in.MachineConfig == nil {
143-
return nil, errors.New("invalid generate request")
144-
}
145-
146-
machineType := v1alpha1machine.Type(in.MachineConfig.Type)
147-
148-
if machineType == v1alpha1machine.TypeWorker {
149-
return nil, errors.New("join config can't be generated in the maintenance mode")
150-
}
151-
152-
return configuration.Generate(ctx, s.controller.Runtime().State().V1Alpha2().Resources(), in)
153-
}
154-
155134
// GenerateClientConfiguration implements the [machine.MachineServiceServer] interface.
156135
func (s *Server) GenerateClientConfiguration(context.Context, *machine.GenerateClientConfigurationRequest) (*machine.GenerateClientConfigurationResponse, error) {
157136
return nil, status.Error(codes.Unimplemented, "client configuration (talosconfig) can't be generated in the maintenance mode")

0 commit comments

Comments
 (0)