Example #1
0
 def list_docker_registry(self):
     """Returns list of docker registries"""
     entities = []
     entities_j = self.o_api.get('imagestream')[1]['items']
     for entity_j in entities_j:
         if 'dockerImageRepository' not in entity_j['status']:
             continue
         meta = entity_j['metadata']
         entity = ImageRegistry(self, meta['name'],
                                entity_j['status']['dockerImageRepository'],
                                meta['namespace'])
         if entity not in entities:
             entities.append(entity)
     return entities
Example #2
0
 def list_image_registry(self):
     """Returns list of image registries (derived from pods)"""
     entities = []
     entities_j = self.api.get('pod')[1]['items']
     for entity_j in entities_j:
         imgs_j = entity_j['status'].get('containerStatuses', [])
         for img_j in imgs_j:
             registry, _, _ = self._parse_image_info(img_j['image'])
             if not registry:
                 continue
             host, _ = registry.split(':') if ':' in registry else (registry, '')
             entity = ImageRegistry(self, host, registry, None)
             if entity not in entities:
                 entities.append(entity)
     return entities
Example #3
0
 def test_invalid_name(self):
     with pytest.raises(InvalidValueException):
         ImageRegistry(provider, 'this/is/invalid/name',
                       'docker.io/openshift/hello-openshift', 'default')
Example #4
0
def gen_image_registry(provider):
    return ImageRegistry(provider, 'openshift-hello-openshift',
                         'docker.io/openshift/hello-openshift', 'default')