mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
builder: support features in inspect command
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
225d61b701
commit
9436c6ca61
@ -415,6 +415,12 @@ describe('parseInspect', () => {
|
||||
"name": "builder0",
|
||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6",
|
||||
"status": "running",
|
||||
"features": {
|
||||
"Cache export": true,
|
||||
"Docker exporter": true,
|
||||
"Multi-platform build": true,
|
||||
"OCI exporter": true,
|
||||
},
|
||||
"labels": {
|
||||
"org.mobyproject.buildkit.worker.executor": "oci",
|
||||
"org.mobyproject.buildkit.worker.hostname": "docker-desktop",
|
||||
|
@ -10,6 +10,11 @@ Status: running
|
||||
BuildKit daemon flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host --allow-insecure-entitlement=network.host
|
||||
BuildKit version: 37657a1
|
||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
Features:
|
||||
Cache export: true
|
||||
Docker exporter: true
|
||||
Multi-platform build: true
|
||||
OCI exporter: true
|
||||
Labels:
|
||||
org.mobyproject.buildkit.worker.executor: oci
|
||||
org.mobyproject.buildkit.worker.hostname: docker-desktop
|
||||
|
@ -149,6 +149,10 @@ export class Builder {
|
||||
currentNode.platforms = platforms.join(',');
|
||||
break;
|
||||
}
|
||||
case lkey == 'features':
|
||||
parsingType = 'features';
|
||||
currentNode.features = {};
|
||||
break;
|
||||
case lkey == 'labels':
|
||||
parsingType = 'label';
|
||||
currentNode.labels = {};
|
||||
@ -162,6 +166,11 @@ export class Builder {
|
||||
break;
|
||||
default: {
|
||||
switch (parsingType || '') {
|
||||
case 'features': {
|
||||
currentNode.features = currentNode.features || {};
|
||||
currentNode.features[key.trim()] = Boolean(value);
|
||||
break;
|
||||
}
|
||||
case 'label': {
|
||||
currentNode.labels = currentNode.labels || {};
|
||||
currentNode.labels[key.trim()] = value;
|
||||
|
@ -32,6 +32,7 @@ export interface Node {
|
||||
export interface NodeInfo extends Node {
|
||||
status?: string;
|
||||
buildkit?: string;
|
||||
features?: Record<string, boolean>;
|
||||
labels?: Record<string, string>;
|
||||
gcPolicy?: Array<GCPolicy>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user