r024: compact Docker inspect output
This commit is contained in:
@@ -68,6 +68,24 @@ try {
|
||||
check('container_runtime_summary() funktioniert', false, $e->getMessage());
|
||||
}
|
||||
|
||||
// ── 3b. Kompakte Inspect-Ausgabe ─────────────────────────────────────────
|
||||
$fixture = json_encode([[
|
||||
'Id' => str_repeat('a', 64),
|
||||
'Name' => '/test',
|
||||
'State' => ['Status' => 'running', 'Running' => true, 'Pid' => 42, 'ExitCode' => 0],
|
||||
'Config' => ['Image' => 'example:latest', 'Env' => ['SECRET=value']],
|
||||
'HostConfig' => ['NetworkMode' => 'bridge'],
|
||||
'NetworkSettings' => ['Ports' => []],
|
||||
'Mounts' => [['Type' => 'bind', 'Source' => '/secret', 'Destination' => '/data']],
|
||||
'RestartCount' => 0,
|
||||
'Created' => 'now',
|
||||
]]);
|
||||
$summaryInspect = json_decode(compact_container_inspect($fixture), true);
|
||||
$fullInspect = json_decode(compact_container_inspect($fixture, 'full'), true);
|
||||
check('Inspect summary laesst Env aus', !isset($summaryInspect['Env']) && !isset($summaryInspect['Mounts']));
|
||||
check('Inspect full enthaelt Env und Mounts', isset($fullInspect['Env']) && isset($fullInspect['Mounts']));
|
||||
check('Inspect full maskiert Secrets', ($fullInspect['Env'][0] ?? '') === 'SECRET=<redacted>');
|
||||
|
||||
// ── 4. Netzwerk-Inventur ─────────────────────────────────────────────────
|
||||
echo "\n[4] Netzwerk-Inventur\n";
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user