mirror of
				https://github.com/docker/setup-buildx-action.git
				synced 2025-10-23 08:56:05 +08:00 
			
		
		
		
	switch back to uuid package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| import * as uuid from 'uuid'; | ||||
| import * as core from '@actions/core'; | ||||
|  | ||||
| import {Docker} from '@docker/actions-toolkit/lib/docker/docker'; | ||||
| @@ -46,7 +47,7 @@ export async function getInputs(): Promise<Inputs> { | ||||
| } | ||||
|  | ||||
| export async function getBuilderName(driver: string): Promise<string> { | ||||
|   return driver == 'docker' ? await Docker.context() : `builder-${crypto.randomUUID()}`; | ||||
|   return driver == 'docker' ? await Docker.context() : `builder-${uuid.v4()}`; | ||||
| } | ||||
|  | ||||
| export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> { | ||||
| @@ -83,7 +84,7 @@ export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit | ||||
|   if (node.name) { | ||||
|     args.push('--node', node.name); | ||||
|   } else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) { | ||||
|     args.push('--node', `node-${crypto.randomUUID()}`); | ||||
|     args.push('--node', `node-${uuid.v4()}`); | ||||
|   } | ||||
|   if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) { | ||||
|     await Util.asyncForEach(node['driver-opts'], async (driverOpt: string) => { | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| import * as fs from 'fs'; | ||||
| import * as yaml from 'js-yaml'; | ||||
| import * as uuid from 'uuid'; | ||||
| import * as core from '@actions/core'; | ||||
| import * as actionsToolkit from '@docker/actions-toolkit'; | ||||
|  | ||||
| @@ -97,7 +98,7 @@ actionsToolkit.run( | ||||
|         }); | ||||
|       }); | ||||
|       if (defaultContextWithTLS) { | ||||
|         const tmpDockerContext = `buildx-${crypto.randomUUID()}`; | ||||
|         const tmpDockerContext = `buildx-${uuid.v4()}`; | ||||
|         await core.group(`Creating temp docker context (TLS data loaded in default one)`, async () => { | ||||
|           await Docker.getExecOutput(['context', 'create', tmpDockerContext], { | ||||
|             ignoreReturnCode: true | ||||
|   | ||||
		Reference in New Issue
	
	Block a user