Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m31s
Foundation / postgres-tools (push) Successful in 27s
Foundation / server-image (push) Successful in 4m33s
Foundation / image (push) Successful in 5m39s
The Regions page opens the next region in place of the one DEV serves: the admin API reads the region overlay, its kustomization, the grant broker and the portal deployment from main at one commit, rewrites only the region id, routes, genesis commit and seeded wildlife range (refusing files whose layout differs), commits them in one Gitea multi-file commit as aevolution-bot, then starts a full Argo sync of exactly that commit. The page follows the sync until the region is live, across the portal's own restart. Credentials come from Secret aevolution-admin mounted read-only as files (--deploy-config); without it the feature stays off. A small OpenSSL HTTPS client talks to Gitea (verified) and argocd-server (verification per ARGOCD_TLS_VERIFY). The portal's NetworkPolicy gains egress to the node's ingress for Gitea and to the argocd-server pods, as approved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.9 KiB
C++
40 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <expected>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// ADR-0182 section 15: the admin portal opens a fresh region in place of the one DEV serves.
|
|
// The change is four Git files edited in place: the region overlay's values (world, region,
|
|
// life routes, the opening's genesis commit and seeded wildlife range, both for the region
|
|
// Deployment and its provision Job), its kustomization header, and the region named by the
|
|
// grant broker's routes and the admin portal. Anything else is left exactly as it is; a file
|
|
// whose layout differs from the expected lines is refused rather than guessed at.
|
|
namespace evo::server::admin {
|
|
inline constexpr std::array<std::string_view, 4> region_switch_paths{
|
|
"deploy/kubernetes/region/dev/region-values.yaml",
|
|
"deploy/kubernetes/region/dev/kustomization.yaml",
|
|
"deploy/kubernetes/grant-broker-dev/deployment.yaml",
|
|
"deploy/kubernetes/admin-portal-dev/deployment.yaml",
|
|
};
|
|
// The four files' text, in region_switch_paths order.
|
|
using RegionSwitchFiles = std::array<std::string, 4>;
|
|
// What the files say DEV serves: the world and region, the opening's genesis commit (32
|
|
// lowercase hex digits) and the first seeded wildlife identity.
|
|
struct RegionLayout {
|
|
std::uint64_t world{}, region{};
|
|
std::string commit;
|
|
std::uint64_t wildlife_first{};
|
|
auto operator<=>(const RegionLayout&) const = default;
|
|
};
|
|
// The served layout, or the name of the line that is missing, repeated or inconsistent.
|
|
[[nodiscard]] std::expected<RegionLayout, std::string>
|
|
read_region_layout(const RegionSwitchFiles& files);
|
|
// The files serving `to` (same world) instead, with `note` (one line, no line breaks) recorded
|
|
// as a comment above the opening; or why the files or `to` cannot be switched.
|
|
[[nodiscard]] std::expected<RegionSwitchFiles, std::string>
|
|
switch_region(const RegionSwitchFiles& files, const RegionLayout& to, std::string_view note);
|
|
} // namespace evo::server::admin
|