fix(libraryagent): 把宿主侧对象存储端点纳入固定命令形态
build / build (push) Failing after 17s

上一提交只给 libraryctl 加了 -source-s3-endpoint,agent 却不知道这个 flag,
systemd 起不来(exit 2)。端点属于"这台主机怎么访问这个源的存储",必须由 agent
自己钉住并随固定声明传给 libraryctl;请求仍然不能改。没配置时不凭空加 flag。

试过:make verify 15 项全绿;新增 agent 声明用例(有端点必传、无端点不多传)。
This commit is contained in:
姚章浩
2026-10-29 06:11:29 +08:00
parent 4d6ecda310
commit faaf003707
3 changed files with 55 additions and 2 deletions
+10 -2
View File
@@ -40,6 +40,9 @@ type Config struct {
SourceApp string
SourcePG string
SourceES string
// SourceS3Endpoint 让宿主机用可达地址读源对象存储:容器 env 里的端点常常
// 只是服务名(minio:9000),宿主机解析不到,资源导出会失败。
SourceS3Endpoint string
GovernancePG string
Project string
Writers string
@@ -268,17 +271,22 @@ func (a *Agent) recoverWriters(ctx context.Context) error {
// declaration pins every path and the writer group so a request cannot redirect
// the operation to another stack, archive or journal.
func (c Config) declaration() []string {
return []string{
args := []string{
"-source-app", c.SourceApp,
"-source-pg", c.SourcePG,
"-source-es", c.SourceES,
}
if c.SourceS3Endpoint != "" {
args = append(args, "-source-s3-endpoint", c.SourceS3Endpoint)
}
return append(args,
"-governance-pg", c.GovernancePG,
"-project", c.Project,
"-writers", c.Writers,
"-non-writers", c.NonWriters,
"-archive", c.ArchiveRoot,
"-journal", c.JournalRoot,
}
)
}
func (c Config) run(ctx context.Context, name string, args ...string) ([]byte, error) {