add tag field git to image object
diff --git a/xos/core/admin.py b/xos/core/admin.py
index e41ad1d..6c7b7b9 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -1206,7 +1206,7 @@
class ImageAdmin(XOSBaseAdmin):
fieldsets = [('Image Details',
- {'fields': ['backend_status_text', 'name', 'kind', 'disk_format', 'container_format'],
+ {'fields': ['backend_status_text', 'name', 'kind', 'disk_format', 'container_format', 'tag'],
'classes': ['suit-tab suit-tab-general']})
]
readonly_fields = ('backend_status_text', )
@@ -1215,7 +1215,7 @@
inlines = [InstanceInline, ControllerImagesInline]
- user_readonly_fields = ['name', 'disk_format', 'container_format']
+ user_readonly_fields = ['name', 'disk_format', 'container_format', 'tag']
list_display = ['backend_status_icon', 'name', 'kind']
list_display_links = ('backend_status_icon', 'name', )
diff --git a/xos/core/models/image.py b/xos/core/models/image.py
index 1a3cbf7..69d0f03 100644
--- a/xos/core/models/image.py
+++ b/xos/core/models/image.py
@@ -16,6 +16,8 @@
path = StrippedCharField(max_length=256, null=True, blank=True, help_text="Path to image on local disk")
deployments = models.ManyToManyField('Deployment', through='ImageDeployments', blank=True, help_text="Select which images should be instantiated on this deployment", related_name='images')
+ tag = StrippedCharField(max_length=256, null=True, blank=True, help_text="For Docker Images, tag of image")
+
def __unicode__(self): return u'%s' % (self.name)
class ImageDeployments(PlCoreBase):
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index e8c360a..10910fb 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -503,7 +503,11 @@
path:
type: string
required: false
- description: Path to Image file inside XOS docker container.
+ description: Path to Image file
+ tag:
+ type: string
+ required: false
+ description: For Docker images, tag of image
tosca.nodes.Controller:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 1e60606..4c12e7f 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -665,7 +665,11 @@
path:
type: string
required: false
- description: Path to Image file inside XOS docker container.
+ description: Path to Image file
+ tag:
+ type: string
+ required: false
+ description: For Docker images, tag of image
tosca.nodes.Controller:
derived_from: tosca.nodes.Root
diff --git a/xos/tosca/resources/image.py b/xos/tosca/resources/image.py
index 938c5cd..fcd53b4 100644
--- a/xos/tosca/resources/image.py
+++ b/xos/tosca/resources/image.py
@@ -15,7 +15,7 @@
class XOSImage(XOSResource):
provides = "tosca.nodes.Image"
xos_model = Image
- copyin_props = ["disk_format", "container_format", "path", "kind"]
+ copyin_props = ["disk_format", "container_format", "path", "kind", "tag"]
def get_xos_args(self):
args = super(XOSImage, self).get_xos_args()