diff --git a/hack/release.toml b/hack/release.toml index f2b30f4ff4..95c0e636cb 100644 --- a/hack/release.toml +++ b/hack/release.toml @@ -23,13 +23,6 @@ preface = """ Talos is built with Go 1.23.4. """ - [notes.machineconfig] - title = "cluster.allowSchedulingOnMasters" - description = """\ -The machine config field item `.cluster.allowSchedulingOnMasters` which has been deprecated since Talos 1.2 has now been removed. -Use the `.cluster.allowSchedulingOnControlPlanes` field instead. -""" - [notes.driver-rebind] title = "Driver Rebind" description = """\ diff --git a/pkg/machinery/config/generate/init.go b/pkg/machinery/config/generate/init.go index 39ae21d70a..8245b9f9f9 100644 --- a/pkg/machinery/config/generate/init.go +++ b/pkg/machinery/config/generate/init.go @@ -190,8 +190,13 @@ func (in *Input) init() ([]config.Document, error) { ClusterInlineManifests: v1alpha1.ClusterInlineManifests{}, } - if in.Options.AllowSchedulingOnControlPlanes && in.Options.VersionContract.KubernetesAllowSchedulingOnControlPlanes() { - cluster.AllowSchedulingOnControlPlanes = pointer.To(in.Options.AllowSchedulingOnControlPlanes) + if in.Options.AllowSchedulingOnControlPlanes { + if in.Options.VersionContract.KubernetesAllowSchedulingOnControlPlanes() { + cluster.AllowSchedulingOnControlPlanes = pointer.To(in.Options.AllowSchedulingOnControlPlanes) + } else { + // backwards compatibility for Talos versions older than 1.2 + cluster.AllowSchedulingOnMasters = pointer.To(in.Options.AllowSchedulingOnControlPlanes) //nolint:staticcheck + } } if in.Options.DiscoveryEnabled != nil { diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_clusterconfig.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_clusterconfig.go index 768dd673a6..9f1ac4c848 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_clusterconfig.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_clusterconfig.go @@ -179,7 +179,11 @@ func (c *ClusterConfig) AdminKubeconfig() config.AdminKubeconfig { // ScheduleOnControlPlanes implements the config.ClusterConfig interface. func (c *ClusterConfig) ScheduleOnControlPlanes() bool { - return pointer.SafeDeref(c.AllowSchedulingOnControlPlanes) + if c.AllowSchedulingOnControlPlanes != nil { + return pointer.SafeDeref(c.AllowSchedulingOnControlPlanes) + } + + return pointer.SafeDeref(c.AllowSchedulingOnMasters) } // ID returns the unique identifier for the cluster. diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_types.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_types.go index 23220da138..ff747349c5 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_types.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_types.go @@ -520,6 +520,10 @@ type ClusterConfig struct { // examples: // - value: clusterAdminKubeconfigExample() AdminKubeconfigConfig *AdminKubeconfigConfig `yaml:"adminKubeconfig,omitempty"` + // docgen:nodoc + // + // Deprecated: Use `AllowSchedulingOnControlPlanes` instead. + AllowSchedulingOnMasters *bool `yaml:"allowSchedulingOnMasters,omitempty"` // description: | // Allows running workload on control-plane nodes. // values: diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go index 78aa2a99e4..742f038c73 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go @@ -527,6 +527,7 @@ func (ClusterConfig) Doc() *encoder.Doc { Description: "Settings for admin kubeconfig generation.\nCertificate lifetime can be configured.", Comments: [3]string{"" /* encoder.HeadComment */, "Settings for admin kubeconfig generation." /* encoder.LineComment */, "" /* encoder.FootComment */}, }, + {}, { Name: "allowSchedulingOnControlPlanes", Type: "bool", @@ -571,7 +572,7 @@ func (ClusterConfig) Doc() *encoder.Doc { }) doc.Fields[22].AddExample("", clusterInlineManifestsExample()) doc.Fields[23].AddExample("", clusterAdminKubeconfigExample()) - doc.Fields[24].AddExample("", true) + doc.Fields[25].AddExample("", true) return doc } diff --git a/pkg/machinery/config/types/v1alpha1/zz_generated.deepcopy.go b/pkg/machinery/config/types/v1alpha1/zz_generated.deepcopy.go index ed094c2dcf..027e512def 100644 --- a/pkg/machinery/config/types/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/machinery/config/types/v1alpha1/zz_generated.deepcopy.go @@ -341,7 +341,11 @@ func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig) { *out = new(AdminKubeconfigConfig) **out = **in } - + if in.AllowSchedulingOnMasters != nil { + in, out := &in.AllowSchedulingOnMasters, &out.AllowSchedulingOnMasters + *out = new(bool) + **out = **in + } if in.AllowSchedulingOnControlPlanes != nil { in, out := &in.AllowSchedulingOnControlPlanes, &out.AllowSchedulingOnControlPlanes *out = new(bool)