mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-18 00:21:22 +00:00
Throw an error when both 'platform' and 'arch' options are supplied during a build
This commit is contained in:
parent
b88e8e76cb
commit
f0d04e6b16
1 changed files with 6 additions and 4 deletions
|
@ -67,6 +67,9 @@ export class BuildahCli implements Buildah {
|
|||
useOCI: boolean, arch: string, platform: string, layers: string, extraArgs: string[]
|
||||
): Promise<CommandResult> {
|
||||
const args: string[] = [ "bud" ];
|
||||
if (arch && platform) {
|
||||
throw new Error("The --platform option may not be used in combination with the --arch option.");
|
||||
}
|
||||
if (arch) {
|
||||
args.push("--arch");
|
||||
args.push(arch);
|
||||
|
@ -122,6 +125,9 @@ export class BuildahCli implements Buildah {
|
|||
core.debug("config");
|
||||
core.debug(container);
|
||||
const args: string[] = [ "config" ];
|
||||
if (settings.arch && settings.platform) {
|
||||
throw new Error("The --platform option may not be used in combination with the --arch option.");
|
||||
}
|
||||
if (settings.entrypoint) {
|
||||
args.push("--entrypoint");
|
||||
args.push(BuildahCli.convertArrayToStringArg(settings.entrypoint));
|
||||
|
@ -186,10 +192,6 @@ export class BuildahCli implements Buildah {
|
|||
): Promise<CommandResult> {
|
||||
// ghCore.info(`${EXECUTABLE} ${args.join(" ")}`)
|
||||
|
||||
if (args.arch && args.platform) {
|
||||
throw new Error("The --platform option may not be used in combination with the --arch option.");
|
||||
}
|
||||
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
|
|
Loading…
Reference in a new issue