Skip to content

Commit b2a83d1

Browse files
smirashanduur
authored andcommitted
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> (cherry picked from commit 4944924)
1 parent 249acdb commit b2a83d1

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
@@ -515,12 +515,6 @@ func (e *Etcd) argsForControlPlane(ctx context.Context, r runtime.Runtime, spec
515515

516516
denyListArgs.Set("initial-cluster", initialCluster)
517517
}
518-
519-
if !extraArgs.Contains("initial-advertise-peer-urls") {
520-
denyListArgs.Set("initial-advertise-peer-urls",
521-
formatEtcdURLs(spec.AdvertisedAddresses, constants.EtcdPeerPort),
522-
)
523-
}
524518
}
525519

526520
if !extraArgs.Contains("advertise-client-urls") {
@@ -529,6 +523,12 @@ func (e *Etcd) argsForControlPlane(ctx context.Context, r runtime.Runtime, spec
529523
)
530524
}
531525

526+
if !extraArgs.Contains("initial-advertise-peer-urls") {
527+
denyListArgs.Set("initial-advertise-peer-urls",
528+
formatEtcdURLs(spec.AdvertisedAddresses, constants.EtcdPeerPort),
529+
)
530+
}
531+
532532
if err = denyListArgs.Merge(extraArgs, denyList); err != nil {
533533
return err
534534
}

0 commit comments

Comments
 (0)