Beispiel #1
0
def test_image_class(string_input, image_result):
    image_name = ImageName.parse(string_input)
    registry, namespace, repository, tag, digest = image_result
    assert image_name.registry == registry
    assert image_name.namespace == namespace
    assert image_name.repository == repository
    assert image_name.tag == tag
    assert image_name.digest == digest
Beispiel #2
0
 def check(self, target):
     im = ImageName.parse(target.instance.baseimage)
     passed = im.tag and im.tag != "latest"
     return CheckResult(ok=passed,
                        description=self.description,
                        message=self.message,
                        reference_url=self.reference_url,
                        check_name=self.name,
                        logs=[])
Beispiel #3
0
    def check(self, target):
        if not target.instance.parent_images:
            raise ColinException("Cannot find FROM instruction.")

        im = ImageName.parse(target.instance.baseimage)
        passed = im.tag and im.tag != "latest"
        return CheckResult(ok=passed,
                           description=self.description,
                           message=self.message,
                           reference_url=self.reference_url,
                           check_name=self.name,
                           logs=[])
Beispiel #4
0
def test_image_class_name_tag(string_input, name_result, tag_result):
    image_name = ImageName.parse(string_input)
    assert image_name.name == name_result
    assert image_name.tag == tag_result