Преглед изворни кода

Use a regex for the image name instead of just "registry:2"

master
Ricardo Branco пре 5 година
родитељ
комит
444f56aec3
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3
    3
      clean_registry.py

+ 3
- 3
clean_registry.py Прегледај датотеку

11
   - This script may run stand-alone (on local setups) or dockerized (which supports remote Docker setups).
11
   - This script may run stand-alone (on local setups) or dockerized (which supports remote Docker setups).
12
   - This script is Python 3 only.
12
   - This script is Python 3 only.
13
 
13
 
14
-v1.3.1 by Ricardo Branco
14
+v1.3.2 by Ricardo Branco
15
 
15
 
16
 MIT License
16
 MIT License
17
 """
17
 """
34
 
34
 
35
 import yaml
35
 import yaml
36
 
36
 
37
-VERSION = "1.3.1"
37
+VERSION = "1.3.2"
38
 REGISTRY_DIR = "REGISTRY_STORAGE_FILESYSTEM_ROOTREGISTRY_DIR"
38
 REGISTRY_DIR = "REGISTRY_STORAGE_FILESYSTEM_ROOTREGISTRY_DIR"
39
 args = None
39
 args = None
40
 
40
 
177
         except (APIError, exceptions.ConnectionError) as err:
177
         except (APIError, exceptions.ConnectionError) as err:
178
             error(err)
178
             error(err)
179
 
179
 
180
-        if self.info['Config']['Image'] != "registry:2":
180
+        if not re.match("registry:2(@sha256:[0-9a-f]{64})?$", self.info['Config']['Image']):
181
             error("The container %s is not running the registry:2 image" % (container))
181
             error("The container %s is not running the registry:2 image" % (container))
182
 
182
 
183
         if LooseVersion(self.get_image_version()) < LooseVersion("v2.4.0"):
183
         if LooseVersion(self.get_image_version()) < LooseVersion("v2.4.0"):

Loading…
Откажи
Сачувај