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 <[email protected]>
(cherry picked from commit 851b91a)
  • Loading branch information
smira committed May 17, 2024
1 parent a91527e commit 172569f
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 @@ -95,7 +95,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 @@ -96,7 +96,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 172569f

Please sign in to comment.