Unverified Commit 36b8a8b4 authored by Lemon-miaow's avatar Lemon-miaow
Browse files

fix(updater): PostgreSQL 大版本提示改为导出再恢复并更正地址相关注释

parent 5d6b36d1
Loading
Loading
Loading
Loading
+5 −6
Changes for deploy/bootstrap.sh: 5 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -977,11 +977,10 @@ detect_node_ip() {
  fi
}

# warn_dynamic_node_ip warns when NODE_IP is a DHCP lease. The address is written into
# the database connection string, pg_hba, the network policies, the panel certificate
# and the default nip.io domain, and nothing re-addresses a live install, so a lease
# that later comes back different takes the whole platform down (the watchdog then
# reports host-address). `ip -o addr` marks a leased address "dynamic".
# warn_dynamic_node_ip warns when NODE_IP is a DHCP lease. The address is the k3s node's
# and is written into the network policies, the panel certificate and the default nip.io
# domain, and nothing re-addresses a live install, so a lease that later comes back
# different takes the platform down (the watchdog then reports host-address). `ip -o addr` marks a leased address "dynamic".
warn_dynamic_node_ip() {
  if ip -4 -o addr show 2>/dev/null | awk -v ip="$NODE_IP" '
      { split($4, a, "/"); if (a[1] == ip && / dynamic /) found = 1 }
@@ -3275,7 +3274,7 @@ deploy_postgres() {
    --postgres-image "$POSTGRES_IMAGE" | kube apply -f -
  if ! kube -n "$CONTROL_NS" rollout status "deployment/${PG_DEPLOYMENT}" --timeout=600s; then
    diagnose_rollout "deployment/${PG_DEPLOYMENT}"
    die "${PG_DEPLOYMENT} did not become ready (docs/troubleshooting.md §13c)"
    die "${PG_DEPLOYMENT} did not become ready (docs/troubleshooting.md §16)"
  fi
  ensure_postgres_role
  ok "${PG_DEPLOYMENT} ready: pods at ${PG_SERVICE_ADDR}, this host at 127.0.0.1:${PG_HOST_PORT}"
+1 −1
Changes for internal/updater/postgres.go: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ func (p postgresFeed) latest(ctx context.Context, current updates.Version) (post
	if !mine.Supported {
		rel.note = fmt.Sprintf("PostgreSQL %s reached end of life on %s and gets no more fixes", key, mine.EOLDate)
		if newest != "" {
			rel.note += fmt.Sprintf("; the current major is %s (pg_upgrade, see docs/operations.md §4)", newest)
			rel.note += fmt.Sprintf("; the current major is %s (a dump and restore, see docs/operations.md §4)", newest)
		}
	}
	return rel, nil
+1 −1
Changes for internal/updater/postgres_test.go: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ func TestPostgresFeedComparesWithinTheMajor(t *testing.T) {
	}{
		{"17.4", "17.10", nil},
		{"18.6", "18.6", nil},
		{"13.22", "13.23", []string{"PostgreSQL 13 reached end of life on 2025-11-13", "current major is 18"}},
		{"13.22", "13.23", []string{"PostgreSQL 13 reached end of life on 2025-11-13", "current major is 18", "dump and restore"}},
		{"9.6.3", "9.6.24", []string{"PostgreSQL 9.6 reached end of life"}},
	}
	for _, c := range cases {
+2 −2
Changes for internal/watchdog/host.go: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ import (
)

const (
	// addressFor is short: nothing reaches the database or the panel while the
	// address is gone, so a DHCP renewal that lands on a new lease is an outage.
	// addressFor is short: the cluster and the panel are down while the address
	// is gone, so a DHCP renewal that lands on a new lease is an outage.
	addressFor = 5 * time.Minute
	// clockFor leaves room for an NTP daemon that was just enabled (by the
	// installer, or after a reboot) to reach its first synchronization.