Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oscontainer: Add support for --display-name #1104

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/oscontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def oscontainer_extract(containers_storage, src, dest,
# oscontainer with it.
def oscontainer_build(containers_storage, src, ref, image_name_and_tag,
base_image, push=False, tls_verify=True,
add_directories=[], cert_dir="", authfile="", inspect_out=None):
add_directories=[], cert_dir="", authfile="", inspect_out=None,
display_name=None):
r = OSTree.Repo.new(Gio.File.new_for_path(src))
r.open(None)

Expand Down Expand Up @@ -174,6 +175,9 @@ def oscontainer_build(containers_storage, src, ref, image_name_and_tag,
'-l', OSCONTAINER_COMMIT_LABEL + '=' + rev]
if ostree_version is not None:
config += ['-l', 'version=' + ostree_version]
if display_name is not None:
config += ['-l', 'io.openshift.build.version-display-names=machine-os=' + display_name,
'-l', 'io.openshift.build.versions=machine-os=' + ostree_version]
run_verbose(buildah_base_argv + ['config'] + config + [bid])
print("Committing container...")
iid = run_get_string(buildah_base_argv + ['commit', bid, image_name_and_tag])
Expand Down Expand Up @@ -239,6 +243,7 @@ def main():
parser_build.add_argument("src", help="OSTree repository")
parser_build.add_argument("rev", help="OSTree ref (or revision)")
parser_build.add_argument("name", help="Image name")
parser_build.add_argument("--display-name", help="Name used for an OpenShift component")
parser_build.add_argument("--add-directory", help="Copy in all content from referenced directory DIR",
metavar='DIR', action='append', default=[])
parser_build.add_argument(
Expand Down Expand Up @@ -269,6 +274,7 @@ def main():
oscontainer_build(
containers_storage, args.src, args.rev, args.name,
getattr(args, 'from'),
display_name=args.display_name,
inspect_out=args.inspect_out,
add_directories=args.add_directory,
push=args.push,
Expand Down