-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pick up buildah base build arguments for container builds
Ensure that buildah is called for kubevirt with the same base arguments like for the oscontainer. Signed-off-by: Roman Mohr <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
|
||
# https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html/builds/custom-builds-buildah | ||
NESTED_BUILD_ARGS = ['--storage-driver', 'vfs'] | ||
|
||
|
||
def buildah_base_args(containers_storage=None): | ||
buildah_base_argv = ['buildah'] | ||
if containers_storage is not None: | ||
buildah_base_argv.append(f"--root={containers_storage}") | ||
if os.environ.get('container') is not None: | ||
print("Using nested container mode due to container environment variable") | ||
buildah_base_argv.extend(NESTED_BUILD_ARGS) | ||
else: | ||
print("Skipping nested container mode") | ||
return buildah_base_argv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters