Skip to content

Commit

Permalink
fix: don't enable hostDNS for versions of Talos which do not have it
Browse files Browse the repository at this point in the history
The problem is that `talosctl cluster create` tries to enable
forwardKubeDNSToHost (for 1.7+), but due to the wrong condition this
tries to enable `hostDNS` for any version of Talos, while it's only
supported since 1.7+.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed May 9, 2024
1 parent 42ac5cd commit 851b91a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/machinery/config/generate/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (in *Input) init() ([]config.Document, error) {
machine.MachineKubelet.KubeletDisableManifestsDirectory = pointer.To(true)
}

if in.Options.VersionContract.HostDNSEnabled() || in.Options.HostDNSForwardKubeDNSToHost.ValueOrZero() {
if in.Options.VersionContract.HostDNSEnabled() {
machine.MachineFeatures.HostDNSSupport = &v1alpha1.HostDNSConfig{
HostDNSEnabled: pointer.To(true),
HostDNSForwardKubeDNSToHost: in.Options.HostDNSForwardKubeDNSToHost.Ptr(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/config/generate/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (in *Input) worker() ([]config.Document, error) {
machine.MachineKubelet.KubeletDisableManifestsDirectory = pointer.To(true)
}

if in.Options.VersionContract.HostDNSEnabled() || in.Options.HostDNSForwardKubeDNSToHost.ValueOrZero() {
if in.Options.VersionContract.HostDNSEnabled() {
machine.MachineFeatures.HostDNSSupport = &v1alpha1.HostDNSConfig{
HostDNSEnabled: pointer.To(true),
HostDNSForwardKubeDNSToHost: in.Options.HostDNSForwardKubeDNSToHost.Ptr(),
Expand Down

0 comments on commit 851b91a

Please sign in to comment.