Browse Source

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

master
Ricardo Branco 5 years ago
parent
commit
444f56aec3
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      clean_registry.py

+ 3
- 3
clean_registry.py View File

@@ -11,7 +11,7 @@ NOTES:
11 11
   - This script may run stand-alone (on local setups) or dockerized (which supports remote Docker setups).
12 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 16
 MIT License
17 17
 """
@@ -34,7 +34,7 @@ from docker.errors import APIError, NotFound, TLSParameterError
34 34
 
35 35
 import yaml
36 36
 
37
-VERSION = "1.3.1"
37
+VERSION = "1.3.2"
38 38
 REGISTRY_DIR = "REGISTRY_STORAGE_FILESYSTEM_ROOTREGISTRY_DIR"
39 39
 args = None
40 40
 
@@ -177,7 +177,7 @@ class RegistryCleaner():
177 177
         except (APIError, exceptions.ConnectionError) as err:
178 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 181
             error("The container %s is not running the registry:2 image" % (container))
182 182
 
183 183
         if LooseVersion(self.get_image_version()) < LooseVersion("v2.4.0"):

Loading…
Cancel
Save