summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Milner <smilner@redhat.com>2017-11-07 15:50:20 -0500
committerSteve Milner <smilner@redhat.com>2017-11-07 15:50:20 -0500
commitd59603544064990f87e8fc18d9ee6cef93592286 (patch)
treeff8c22806fa9736208d2fd22144ed7a497cf5cfc
parent80fdf0d5a4215ad57388dfec9634685502d581af (diff)
downloadopenshift-d59603544064990f87e8fc18d9ee6cef93592286.tar.gz
openshift-d59603544064990f87e8fc18d9ee6cef93592286.tar.bz2
openshift-d59603544064990f87e8fc18d9ee6cef93592286.tar.xz
openshift-d59603544064990f87e8fc18d9ee6cef93592286.zip
container_binary_sync: Remove atomic prefix from image
Signed-off-by: Steve Milner <smilner@redhat.com>
-rw-r--r--roles/openshift_cli/library/openshift_container_binary_sync.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/roles/openshift_cli/library/openshift_container_binary_sync.py b/roles/openshift_cli/library/openshift_container_binary_sync.py
index b40c49701..08045794a 100644
--- a/roles/openshift_cli/library/openshift_container_binary_sync.py
+++ b/roles/openshift_cli/library/openshift_container_binary_sync.py
@@ -36,7 +36,7 @@ class BinarySyncer(object):
self.changed = False
self.output = []
self.bin_dir = '/usr/local/bin'
- self.image = image
+ self._image = image
self.tag = tag
self.backend = backend
self.temp_dir = None # TBD
@@ -142,6 +142,33 @@ class BinarySyncer(object):
self.output.append("Moved %s to %s." % (src_path, dest_path))
self.changed = True
+ @property
+ def raw_image(self):
+ """
+ Returns the image as it was originally passed in to the instance.
+
+ .. note::
+ This image string will only work directly with the atomic command.
+
+ :returns: The original image passed in.
+ :rtype: str
+ """
+ return self._image
+
+ @property
+ def image(self):
+ """
+ Returns the image without atomic prefixes used to map to skopeo args.
+
+ :returns: The image string without prefixes
+ :rtype: str
+ """
+ image = self._image
+ for remove in ('oci:', 'http:', 'https:'):
+ if image.startswith(remove):
+ image = image.replace(remove, '')
+ return image
+
def main():
module = AnsibleModule( # noqa: F405