Skip to content

Commit 70d53ee

Browse files
committed
chore: deprecate .persist and .extensions
This commit deprecates those things: - Removes the support of `.persist` flag. From now, it should always be enabled or not defined in the config. - Removes the documentation for `.bootloader`. It never worked anyway. - Adds a warning for `.machine.install.extensions`, suggests to use boot-assets. Closes #7972 Closes #7507 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
1 parent 95e33f6 commit 70d53ee

File tree

17 files changed

+38
-131
lines changed

17 files changed

+38
-131
lines changed

api/api.descriptors

223 Bytes
Binary file not shown.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ require (
288288
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect
289289
github.com/sethgrid/pester v1.2.0 // indirect
290290
github.com/siderolabs/go-api-signature v0.3.1 // indirect
291-
github.com/siderolabs/protoenc v0.2.0 // indirect
291+
github.com/siderolabs/protoenc v0.2.1 // indirect
292292
github.com/siderolabs/tcpproxy v0.1.0 // indirect
293293
github.com/sirupsen/logrus v1.9.3 // indirect
294294
github.com/spf13/afero v1.9.3 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM
127127
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
128128
github.com/briandowns/spinner v1.19.0 h1:s8aq38H+Qju89yhp89b4iIiMzMm8YN3p6vGpwyh/a8E=
129129
github.com/briandowns/spinner v1.19.0/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU=
130-
github.com/brianvoe/gofakeit/v6 v6.17.0 h1:obbQTJeHfktJtiZzq0Q1bEpsNUs+yHrYlPVWt7BtmJ4=
131-
github.com/brianvoe/gofakeit/v6 v6.17.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8=
130+
github.com/brianvoe/gofakeit/v6 v6.24.0 h1:74yq7RRz/noddscZHRS2T84oHZisW9muwbb8sRnU52A=
131+
github.com/brianvoe/gofakeit/v6 v6.24.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8=
132132
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
133133
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
134134
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
@@ -689,8 +689,8 @@ github.com/siderolabs/kms-client v0.1.0 h1:rCDWzcDDsNlp6zdyLngOuuhchVILn+vwUQy3t
689689
github.com/siderolabs/kms-client v0.1.0/go.mod h1:4UQkRhuEh3kaK7VhJxez4YyJLv6lPEff7g3Pa6Y9okg=
690690
github.com/siderolabs/net v0.4.0 h1:1bOgVay/ijPkJz4qct98nHsiB/ysLQU0KLoBC4qLm7I=
691691
github.com/siderolabs/net v0.4.0/go.mod h1:/ibG+Hm9HU27agp5r9Q3eZicEfjquzNzQNux5uEk0kM=
692-
github.com/siderolabs/protoenc v0.2.0 h1:QFxWIAo//12+/bm27GNYoK/TpQGTYsRrrZCu9jSghvU=
693-
github.com/siderolabs/protoenc v0.2.0/go.mod h1:mu4gc6pJxhdJYpuloacKE4jsJojj87qDXwn8LUvs2bY=
692+
github.com/siderolabs/protoenc v0.2.1 h1:BqxEmeWQeMpNP3R6WrPqDatX8sM/r4t97OP8mFmg6GA=
693+
github.com/siderolabs/protoenc v0.2.1/go.mod h1:StTHxjet1g11GpNAWiATgc8K0HMKiFSEVVFOa/H0otc=
694694
github.com/siderolabs/siderolink v0.3.2 h1:ULFHQAgxtVCU7Sd+GLP7bDSQBXrwTtppaI4TKl/YqZc=
695695
github.com/siderolabs/siderolink v0.3.2/go.mod h1:juxlSF9cBzeBHsOjS7hVS3s0NDpC034i/OZunVReqmo=
696696
github.com/siderolabs/tcpproxy v0.1.0 h1:IbkS9vRhjMOscc1US3M5P1RnsGKFgB6U5IzUk+4WkKA=

internal/app/machined/pkg/controllers/config/acquire.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,6 @@ func (ctrl *AcquireController) loadFromDisk(logger *zap.Logger) (config.Provider
238238
return nil, fmt.Errorf("failed to load config from STATE: %w", err)
239239
}
240240

241-
// TODO: this is legacy flow with persistence, it should be deprecated & removed
242-
if !cfg.Persist() {
243-
logger.Info("config persistence is disabled, ignoring stored machine config")
244-
245-
return nil, nil
246-
}
247-
248241
// if the STATE partition is present & contains machine config, Talos is already installed
249242
warnings, err := cfg.Validate(validationModeDiskConfig{})
250243
if err != nil {

pkg/cluster/kubernetes/patch.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ func patchNodeConfig(ctx context.Context, cluster UpgradeProvider, node string,
3737
return fmt.Errorf("config is not v1alpha1 config")
3838
}
3939

40-
if !cfg.Persist() {
41-
return fmt.Errorf("config persistence is disabled, patching is not supported")
42-
}
43-
4440
if err = patchFunc(cfg); err != nil {
4541
return fmt.Errorf("error patching config: %w", err)
4642
}

pkg/machinery/config/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package config
88
// Config defines the interface to access contents of the machine configuration.
99
type Config interface {
1010
Debug() bool
11-
Persist() bool
1211
Machine() MachineConfig
1312
Cluster() ClusterConfig
1413
SideroLink() SideroLinkConfig

pkg/machinery/config/container/container.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ func (container *Container) Debug() bool {
110110
return container.v1alpha1Config.Debug()
111111
}
112112

113-
// Persist implements config.Config interface.
114-
func (container *Container) Persist() bool {
115-
if container.v1alpha1Config == nil {
116-
return true
117-
}
118-
119-
return container.v1alpha1Config.Persist()
120-
}
121-
122113
// Machine implements config.Config interface.
123114
func (container *Container) Machine() config.MachineConfig {
124115
if container.v1alpha1Config == nil {

pkg/machinery/config/types/v1alpha1/schemas/v1alpha1_config.schema.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,8 @@
697697
"persist": {
698698
"type": "boolean",
699699
"title": "persist",
700-
"description": "description: |\n Indicates whether to pull the machine config upon every boot.\n\nNote: this option is deprecated and it will be removed in Talos 1.6.\n values:\n - true\n - yes\n - false\n - no\n",
701-
"markdownDescription": "description: |\n Indicates whether to pull the machine config upon every boot.\n\n **Note**: this option is deprecated and it will be removed in Talos 1.6.\n values:\n - true\n - yes\n - false\n - no",
702-
"x-intellij-html-description": "\u003cp\u003edescription: |\n Indicates whether to pull the machine config upon every boot.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e: this option is deprecated and it will be removed in Talos 1.6.\n values:\n - true\n - yes\n - false\n - no\u003c/p\u003e\n"
700+
"markdownDescription": "",
701+
"x-intellij-html-description": ""
703702
},
704703
"machine": {
705704
"$ref": "#/$defs/MachineConfig",
@@ -1500,13 +1499,6 @@
15001499
"markdownDescription": "Allows for supplying additional system extension images to install on top of base Talos image.",
15011500
"x-intellij-html-description": "\u003cp\u003eAllows for supplying additional system extension images to install on top of base Talos image.\u003c/p\u003e\n"
15021501
},
1503-
"bootloader": {
1504-
"type": "boolean",
1505-
"title": "bootloader",
1506-
"description": "Indicates if a bootloader should be installed.\n",
1507-
"markdownDescription": "Indicates if a bootloader should be installed.",
1508-
"x-intellij-html-description": "\u003cp\u003eIndicates if a bootloader should be installed.\u003c/p\u003e\n"
1509-
},
15101502
"wipe": {
15111503
"type": "boolean",
15121504
"title": "wipe",

pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ func (c *Config) Debug() bool {
6161
return pointer.SafeDeref(c.ConfigDebug)
6262
}
6363

64-
// Persist implements the config.Provider interface.
65-
func (c *Config) Persist() bool {
66-
if c == nil {
67-
return true
68-
}
69-
70-
return pointer.SafeDeref(c.ConfigPersist)
71-
}
72-
7364
// Machine implements the config.Provider interface.
7465
func (c *Config) Machine() config.MachineConfig {
7566
if c == nil || c.MachineConfig == nil {

pkg/machinery/config/types/v1alpha1/v1alpha1_types.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,7 @@ type Config struct {
6363
// - false
6464
// - no
6565
ConfigDebug *bool `yaml:"debug,omitempty"`
66-
// description: |
67-
// Indicates whether to pull the machine config upon every boot.
68-
//
69-
// **Note**: this option is deprecated and it will be removed in Talos 1.6.
70-
// values:
71-
// - true
72-
// - yes
73-
// - false
74-
// - no
66+
//docgen:nodoc
7567
ConfigPersist *bool `yaml:"persist,omitempty"`
7668
// description: |
7769
// Provides machine specific configuration options.
@@ -775,13 +767,9 @@ type InstallConfig struct {
775767
// examples:
776768
// - value: installExtensionsExample()
777769
InstallExtensions []InstallExtensionConfig `yaml:"extensions,omitempty"`
778-
// description: |
779-
// Indicates if a bootloader should be installed.
780-
// values:
781-
// - true
782-
// - yes
783-
// - false
784-
// - no
770+
// docgen:nodoc
771+
//
772+
// Deprecated: It never worked.
785773
InstallBootloader *bool `yaml:"bootloader,omitempty"`
786774
// description: |
787775
// Indicates if the installation disk should be wiped at installation time.

0 commit comments

Comments
 (0)