fix: bound agentrun restart dry-run output
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
This commit is contained in:
@@ -131,6 +131,7 @@ export function compactAgentRunLaneStatusTarget(spec: AgentRunLaneSpec): Record<
|
||||
|
||||
export async function restartYamlLane(config: UniDeskConfig, options: LaneConfirmOptions): Promise<Record<string, unknown>> {
|
||||
const { configPath, spec } = resolveAgentRunLaneTarget(options);
|
||||
const target = options.full || options.raw ? agentRunLaneSummary(spec) : compactAgentRunLaneStatusTarget(spec);
|
||||
const plan = {
|
||||
node: spec.nodeId,
|
||||
kubeRoute: spec.nodeKubeRoute,
|
||||
@@ -139,6 +140,26 @@ export async function restartYamlLane(config: UniDeskConfig, options: LaneConfir
|
||||
deployment: spec.runtime.managerDeployment,
|
||||
annotation: "kubectl.kubernetes.io/restartedAt",
|
||||
reason: "reload-lane-secrets-or-runtime-env",
|
||||
patchType: "deployment-template-annotation",
|
||||
secretRefs: {
|
||||
count: spec.secrets.length,
|
||||
items: spec.secrets.map((secret) => ({
|
||||
id: secret.id,
|
||||
namespace: secret.targetRef.namespace,
|
||||
name: secret.targetRef.name,
|
||||
key: secret.targetRef.key,
|
||||
providerCredentialProfile: secret.providerCredentialProfile,
|
||||
valuesPrinted: false,
|
||||
})),
|
||||
valuesPrinted: false,
|
||||
},
|
||||
providerCredentials: agentRunProviderCredentialRefs(spec).map((credential) => ({
|
||||
profile: credential.profile,
|
||||
namespace: credential.secretRef.namespace,
|
||||
name: credential.secretRef.name,
|
||||
keys: credential.secretRef.keys,
|
||||
valuesPrinted: false,
|
||||
})),
|
||||
valuesPrinted: false,
|
||||
};
|
||||
if (options.dryRun || !options.confirm) {
|
||||
@@ -148,11 +169,12 @@ export async function restartYamlLane(config: UniDeskConfig, options: LaneConfir
|
||||
mode: "dry-run",
|
||||
mutation: false,
|
||||
configPath,
|
||||
target: agentRunLaneSummary(spec),
|
||||
target,
|
||||
plan,
|
||||
next: {
|
||||
confirm: `bun scripts/cli.ts agentrun control-plane restart --node ${spec.nodeId} --lane ${spec.lane} --confirm`,
|
||||
status: `bun scripts/cli.ts agentrun control-plane status --node ${spec.nodeId} --lane ${spec.lane}`,
|
||||
full: `bun scripts/cli.ts agentrun control-plane restart --node ${spec.nodeId} --lane ${spec.lane} --dry-run --full`,
|
||||
},
|
||||
valuesPrinted: false,
|
||||
};
|
||||
@@ -165,12 +187,13 @@ export async function restartYamlLane(config: UniDeskConfig, options: LaneConfir
|
||||
mode: "confirmed-rollout-restart",
|
||||
mutation: true,
|
||||
configPath,
|
||||
target: agentRunLaneSummary(spec),
|
||||
target,
|
||||
plan,
|
||||
result: payload,
|
||||
capture: compactCapture(result, { full: result.exitCode !== 0, stdoutTailChars: 4000, stderrTailChars: 4000 }),
|
||||
next: {
|
||||
status: `bun scripts/cli.ts agentrun control-plane status --node ${spec.nodeId} --lane ${spec.lane}`,
|
||||
full: `bun scripts/cli.ts agentrun control-plane restart --node ${spec.nodeId} --lane ${spec.lane} --dry-run --full`,
|
||||
},
|
||||
valuesPrinted: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user