Skip to content

Commit

Permalink
fix: default dns domain to 'cluster.local' in local case
Browse files Browse the repository at this point in the history
One case was missing: when network section is present, but value is
omitted.

Fixes #6825

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
smira committed Feb 8, 2023
1 parent cc6e37a commit e09e106
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (suite *KubeletConfigSuite) TestReconcileDefaults() {

suite.Assert().Equal("kubelet", spec.Image)
suite.Assert().Equal([]string{"10.96.0.10"}, spec.ClusterDNS)
suite.Assert().Equal("", spec.ClusterDomain)
suite.Assert().Equal(constants.DefaultDNSDomain, spec.ClusterDomain)
suite.Assert().Empty(spec.ExtraArgs)
suite.Assert().Empty(spec.ExtraMounts)
suite.Assert().False(spec.CloudProviderExternal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (c *ClusterConfig) ServiceCIDRs() []string {

// DNSDomain implements the config.ClusterNetwork interface.
func (c *ClusterConfig) DNSDomain() string {
if c.ClusterNetwork == nil {
if c.ClusterNetwork == nil || c.ClusterNetwork.DNSDomain == "" {
return constants.DefaultDNSDomain
}

Expand Down

0 comments on commit e09e106

Please sign in to comment.