mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 17:11:23 +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[]
|
useOCI: boolean, arch: string, platform: string, layers: string, extraArgs: string[]
|
||||||
): Promise<CommandResult> {
|
): Promise<CommandResult> {
|
||||||
const args: string[] = [ "bud" ];
|
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) {
|
if (arch) {
|
||||||
args.push("--arch");
|
args.push("--arch");
|
||||||
args.push(arch);
|
args.push(arch);
|
||||||
|
@ -122,6 +125,9 @@ export class BuildahCli implements Buildah {
|
||||||
core.debug("config");
|
core.debug("config");
|
||||||
core.debug(container);
|
core.debug(container);
|
||||||
const args: string[] = [ "config" ];
|
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) {
|
if (settings.entrypoint) {
|
||||||
args.push("--entrypoint");
|
args.push("--entrypoint");
|
||||||
args.push(BuildahCli.convertArrayToStringArg(settings.entrypoint));
|
args.push(BuildahCli.convertArrayToStringArg(settings.entrypoint));
|
||||||
|
@ -186,10 +192,6 @@ export class BuildahCli implements Buildah {
|
||||||
): Promise<CommandResult> {
|
): Promise<CommandResult> {
|
||||||
// ghCore.info(`${EXECUTABLE} ${args.join(" ")}`)
|
// 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 stdout = "";
|
||||||
let stderr = "";
|
let stderr = "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue