history: inspect command support

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-04-10 21:35:18 +02:00
parent e12c042e86
commit e1c74199da
3 changed files with 165 additions and 6 deletions

View File

@@ -14,12 +14,101 @@
* limitations under the License.
*/
export interface ExportRecordOpts {
export interface InspectOpts {
ref?: string;
builder?: string;
}
export type BuildStatus = 'completed' | 'running' | 'failed' | 'canceled';
export interface InspectResponse {
Name?: string;
Ref: string;
Context?: string;
Dockerfile?: string;
VCSRepository?: string;
VCSRevision?: string;
Target?: string;
Platform?: Array<string>;
KeepGitDir?: boolean;
NamedContexts?: Array<InspectKeyValueOutput>;
StartedAt?: Date;
CompletedAt?: Date;
Duration?: number;
Status?: BuildStatus;
Error?: InspectErrorOutput;
NumCompletedSteps: number;
NumTotalSteps: number;
NumCachedSteps: number;
BuildArgs?: Array<InspectKeyValueOutput>;
Labels?: Array<InspectKeyValueOutput>;
Config?: InspectConfigOutput;
Materials?: InspectMaterialOutput[];
Attachments?: InspectAttachmentOutput[];
Errors?: Array<string>;
}
export interface InspectConfigOutput {
Network?: string;
ExtraHosts?: Array<string>;
Hostname?: string;
CgroupParent?: string;
ImageResolveMode?: string;
MultiPlatform?: boolean;
NoCache?: boolean;
NoCacheFilter?: Array<string>;
ShmSize?: string;
Ulimit?: string;
CacheMountNS?: string;
DockerfileCheckConfig?: string;
SourceDateEpoch?: string;
SandboxHostname?: string;
RestRaw?: Array<InspectKeyValueOutput>;
}
export interface InspectMaterialOutput {
URI?: string;
Digests?: Array<string>;
}
export interface InspectAttachmentOutput {
Digest?: string;
Platform?: string;
Type?: string;
}
export interface InspectErrorOutput {
Code?: number;
Message?: string;
Name?: string;
Logs?: Array<string>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Sources?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Stack?: any;
}
export interface InspectKeyValueOutput {
Name?: string;
Value?: string;
}
export interface ExportBuildOpts {
refs: Array<string>;
image?: string;
}
export interface ExportRecordResponse {
export interface ExportBuildResponse {
dockerbuildFilename: string;
dockerbuildSize: number;
summaries: Summaries;
@@ -29,10 +118,10 @@ export interface ExportRecordResponse {
}
export interface Summaries {
[ref: string]: RecordSummary;
[ref: string]: Summary;
}
export interface RecordSummary {
export interface Summary {
name: string;
status: string;
duration: string;