fix: scope codex-pool sentinel image to enabled targets
This commit is contained in:
@@ -95,9 +95,9 @@ export async function codexPoolSync(config: UniDeskConfig, options: SyncOptions)
|
||||
};
|
||||
}
|
||||
|
||||
const sentinelImage = pool.sentinel.monitor.enabled
|
||||
const sentinelImage = pool.sentinel.monitor.enabled && runtimeTarget.sentinelEnabled
|
||||
? await runCodexPoolSentinelImage(config, pool, { action: "build", confirm: true, dryRun: false, full: options.full, raw: false, targetId: options.targetId })
|
||||
: { ok: true, mode: "skipped-monitor-disabled" };
|
||||
: { ok: true, mode: runtimeTarget.sentinelEnabled ? "skipped-monitor-disabled" : "skipped-target-disabled" };
|
||||
if (sentinelImage.ok !== true) {
|
||||
return {
|
||||
ok: false,
|
||||
@@ -113,17 +113,20 @@ export async function codexPoolSync(config: UniDeskConfig, options: SyncOptions)
|
||||
const payload = {
|
||||
pruneRemoved: options.pruneRemoved,
|
||||
sentinel: {
|
||||
manifest: renderCodexPoolSentinelManifest(pool.sentinel, sentinelProfileSecrets(profiles), {
|
||||
namespace: runtimeTarget.namespace,
|
||||
serviceName: runtimeTarget.serviceName,
|
||||
serviceDns: runtimeTarget.serviceDns,
|
||||
appSecretName: runtimeTarget.appSecretName,
|
||||
adminEmailDefault: pool.adminEmailDefault,
|
||||
proxy: runtimeTarget.egressProxy?.applyToSentinel ? {
|
||||
httpProxy: runtimeTarget.egressProxy.httpProxy,
|
||||
noProxy: runtimeTarget.egressProxy.noProxy,
|
||||
} : null,
|
||||
}),
|
||||
enabledForTarget: runtimeTarget.sentinelEnabled,
|
||||
manifest: runtimeTarget.sentinelEnabled
|
||||
? renderCodexPoolSentinelManifest(pool.sentinel, sentinelProfileSecrets(profiles), {
|
||||
namespace: runtimeTarget.namespace,
|
||||
serviceName: runtimeTarget.serviceName,
|
||||
serviceDns: runtimeTarget.serviceDns,
|
||||
appSecretName: runtimeTarget.appSecretName,
|
||||
adminEmailDefault: pool.adminEmailDefault,
|
||||
proxy: runtimeTarget.egressProxy?.applyToSentinel ? {
|
||||
httpProxy: runtimeTarget.egressProxy.httpProxy,
|
||||
noProxy: runtimeTarget.egressProxy.noProxy,
|
||||
} : null,
|
||||
})
|
||||
: null,
|
||||
summary: codexPoolSentinelSummary(pool.sentinel),
|
||||
},
|
||||
pool: {
|
||||
@@ -215,6 +218,20 @@ export async function codexPoolSentinelImage(config: UniDeskConfig, options: Sen
|
||||
export async function runCodexPoolSentinelImage(config: UniDeskConfig, pool: CodexPoolConfig, options: SentinelImageOptions): Promise<Record<string, unknown>> {
|
||||
const runtimeTarget = codexPoolRuntimeTarget(options.targetId);
|
||||
const target = codexPoolSentinelRuntimeImage(pool.sentinel);
|
||||
if (!runtimeTarget.sentinelEnabled) {
|
||||
return {
|
||||
ok: true,
|
||||
action: "platform-infra-sub2api-codex-pool-sentinel-image",
|
||||
mode: "skipped-target-disabled",
|
||||
target: {
|
||||
id: runtimeTarget.id,
|
||||
namespace: runtimeTarget.namespace,
|
||||
},
|
||||
image: target,
|
||||
mutation: false,
|
||||
valuesPrinted: false,
|
||||
};
|
||||
}
|
||||
if (options.action === "build" && options.dryRun) {
|
||||
return {
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user