mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-04-21 18:16:46 +00:00
switch back to uuid package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
8026d2bc36
commit
2874e980e8
5 changed files with 29 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue