Skip to content

Commit

Permalink
Trim label names and values (cdrx#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimw authored Sep 7, 2021
1 parent a24d813 commit 5e178ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rancher_gitlab_deploy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,14 @@ def main(
labels_as_array = labels.split(rancher_label_separator)

for label_item in labels_as_array:
key, value = label_item.split("=", 1)
defined_labels[key] = value
label_item = label_item.strip()

if label_item:
key, value = label_item.split("=", 1)
key = key.strip()
value = value.strip()

defined_labels[key] = value

if label:
for item in label:
Expand Down Expand Up @@ -280,7 +286,7 @@ def main(
if secret_item:
key, value = secret_item.split("=", 1)
key = key.strip()

defined_secrets.append({"type": "secretReference", "name": key})

if secret:
Expand Down

0 comments on commit 5e178ca

Please sign in to comment.