🌳
pt0/deployF/ptDeployActions/checkimghealthActionAI.mts
7export const checkimghealth = async () => {
8 const tagArg = cliArg('--tag') || 'dfc54dee821b'
9 const blob = cliArg('--blob')
10 const verifyBlobs = cliFlag('--verify-blobs')
11 const {dockreg_host} = getKlusterCtx()
13 if (blob) {
14 console.log('Checking blob:', blob)
15 const health = await checkBlobHealth({dockreg_host, digest: blob})
16 console.log(' health:', JSON.stringify(health, null, 2))
17 return
18 }
20 // --tag accepts a bare tag (localrepo/localrepo) or a full repo_name_tag (host/repo[:sub]:tag | @digest)
21 const {repoPath, tag} = tagArg.includes('/') ? parseRepoNameTag(tagArg) : {repoPath: 'localrepo/localrepo', tag: tagArg}
22 const manifest_url = mkManifestUrl(dockreg_host, repoPath, tag)
24 console.log('Checking image health:')
25 console.log(' tag:', tagArg)
26 console.log(' manifest_url:', manifest_url)
27 console.log(' verifyBlobs:', verifyBlobs)
29 const health = await checkDockImgHealth({manifest_url, verifyBlobs})
30 console.log(' health:', JSON.stringify(health, null, 2))
33checkimghealth.cliSchema = {
34 tag: { type: 'string' as const, desc: 'docker image tag' },
35 blob: { type: 'string' as const, desc: 'blob digest to check' },
36 'verify-blobs': { flag: true as const, desc: 'verify blob health' },
38checkimghealth.cliDescript = 'Check docker image health (--tag=<tag> --verify-blobs --blob=<digest>)'
39checkimghealth.cliAdvanced = true