Skip to content

Commit

Permalink
chore: revert: drop deprecated allowSchedulingOnMasters
Browse files Browse the repository at this point in the history
This reverts commit 32c67c2.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Jan 8, 2025
1 parent 0abb3da commit fa5300d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
7 changes: 0 additions & 7 deletions hack/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """\
Expand Down
9 changes: 7 additions & 2 deletions pkg/machinery/config/generate/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions pkg/machinery/config/types/v1alpha1/v1alpha1_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion pkg/machinery/config/types/v1alpha1/v1alpha1_types_doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pkg/machinery/config/types/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa5300d

Please sign in to comment.