|
|
@ -184,6 +184,18 @@ class Build(command.Command): |
|
|
|
"(default: %(default)s)" |
|
|
|
), |
|
|
|
) |
|
|
|
parser.add_argument( |
|
|
|
"--label", |
|
|
|
dest="labels", |
|
|
|
metavar="<label-data>", |
|
|
|
default=[], |
|
|
|
action="append", |
|
|
|
help=_( |
|
|
|
"Add labels to the containers. This option can be " |
|
|
|
"specified multiple times. Each label is a key=value " |
|
|
|
"pair." |
|
|
|
), |
|
|
|
) |
|
|
|
parser.add_argument( |
|
|
|
"--volume", |
|
|
|
dest="volumes", |
|
|
@ -562,6 +574,26 @@ class Build(command.Command): |
|
|
|
rhel_modules.update({name: version}) |
|
|
|
image_config['tcib_rhel_modules'] = rhel_modules |
|
|
|
|
|
|
|
if parsed_args.labels: |
|
|
|
_desc = "OpenStack Platform {}".format(image_parsed_name) |
|
|
|
label_data = image_config['tcib_labels'] = { |
|
|
|
"tcib_managed": True, |
|
|
|
"maintainer": "OpenStack TripleO Team", |
|
|
|
"description": _desc, |
|
|
|
"summary": _desc, |
|
|
|
"io.k8s.display-name": _desc, |
|
|
|
} |
|
|
|
for item in parsed_args.labels: |
|
|
|
key, value = item.split("=", 1) |
|
|
|
label_data[key] = value % dict( |
|
|
|
registry=parsed_args.registry, |
|
|
|
namespace=parsed_args.namespace, |
|
|
|
prefix=parsed_args.prefix, |
|
|
|
image=image_name, |
|
|
|
tag=parsed_args.tag, |
|
|
|
name=image_parsed_name, |
|
|
|
) |
|
|
|
|
|
|
|
# NOTE(cloudnull): Check if the reference config has a valid |
|
|
|
# "from" option. If the reference "from" |
|
|
|
# option is valid, it will be used. |
|
|
|