Skip to content

Commit 4944924

Browse files
committed
fix: always set advertised peer URLs
It seems that etcd might derive them incorrectly on IPv6-only system. This change is confusing, as it sets the `--initial-` prefixed flag even after join, but it seems that on etcd side, the configuration value is used always despite the flag name. Fixes #12646 (see the issue for more details) Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 782cc50 commit 4944924

File tree

1 file changed

+6
-6
lines changed
  • internal/app/machined/pkg/system/services

1 file changed

+6
-6
lines changed

internal/app/machined/pkg/system/services/etcd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,6 @@ func (e *Etcd) argsForControlPlane(ctx context.Context, r runtime.Runtime, spec
528528

529529
denyListArgs.Set("initial-cluster", argsbuilder.Value{initialCluster})
530530
}
531-
532-
if !extraArgs.Contains("initial-advertise-peer-urls") {
533-
denyListArgs.Set("initial-advertise-peer-urls",
534-
argsbuilder.Value{formatEtcdURLs(spec.AdvertisedAddresses, constants.EtcdPeerPort)},
535-
)
536-
}
537531
}
538532

539533
if !extraArgs.Contains("advertise-client-urls") {
@@ -542,6 +536,12 @@ func (e *Etcd) argsForControlPlane(ctx context.Context, r runtime.Runtime, spec
542536
)
543537
}
544538

539+
if !extraArgs.Contains("initial-advertise-peer-urls") {
540+
denyListArgs.Set("initial-advertise-peer-urls",
541+
argsbuilder.Value{formatEtcdURLs(spec.AdvertisedAddresses, constants.EtcdPeerPort)},
542+
)
543+
}
544+
545545
if err = denyListArgs.Merge(extraArgs, denyList); err != nil {
546546
return err
547547
}

0 commit comments

Comments
 (0)