docker-image-pin 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docker_image_pin/__init__.py +16 -4
- {docker_image_pin-0.1.1.dist-info → docker_image_pin-0.2.0.dist-info}/METADATA +1 -1
- docker_image_pin-0.2.0.dist-info/RECORD +6 -0
- docker_image_pin-0.1.1.dist-info/RECORD +0 -6
- {docker_image_pin-0.1.1.dist-info → docker_image_pin-0.2.0.dist-info}/WHEEL +0 -0
- {docker_image_pin-0.1.1.dist-info → docker_image_pin-0.2.0.dist-info}/entry_points.txt +0 -0
- {docker_image_pin-0.1.1.dist-info → docker_image_pin-0.2.0.dist-info}/licenses/LICENSE +0 -0
docker_image_pin/__init__.py
CHANGED
@@ -27,7 +27,7 @@ def parse_args() -> Args:
|
|
27
27
|
return parser.parse_args(namespace=Args())
|
28
28
|
|
29
29
|
|
30
|
-
def main() -> int:
|
30
|
+
def main() -> int: # noqa: C901
|
31
31
|
args = parse_args()
|
32
32
|
|
33
33
|
retval = 0
|
@@ -41,10 +41,22 @@ def main() -> int:
|
|
41
41
|
content = file.read_text()
|
42
42
|
|
43
43
|
for line in content.splitlines():
|
44
|
-
line = line.strip()
|
44
|
+
line = line.strip()
|
45
45
|
if not line.startswith("image:"):
|
46
46
|
continue
|
47
|
-
|
47
|
+
|
48
|
+
if "#" in line:
|
49
|
+
line, comment = line.split("#")
|
50
|
+
line = line.strip()
|
51
|
+
comment = comment.strip()
|
52
|
+
if not comment.startswith("allow-"):
|
53
|
+
invalid("comment on image did not start with 'allow-'")
|
54
|
+
continue
|
55
|
+
allow = comment.removeprefix("allow-")
|
56
|
+
else:
|
57
|
+
allow = None
|
58
|
+
|
59
|
+
line = line.removeprefix("image:").strip()
|
48
60
|
try:
|
49
61
|
rest, sha = line.split("@")
|
50
62
|
except ValueError:
|
@@ -56,7 +68,7 @@ def main() -> int:
|
|
56
68
|
invalid("no ':' in leading part")
|
57
69
|
continue
|
58
70
|
|
59
|
-
if version in {"latest", "stable"}:
|
71
|
+
if version in {"latest", "stable"} and allow != version:
|
60
72
|
invalid(f"uses dynamic tag '{version}' instead of pinned version")
|
61
73
|
continue
|
62
74
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: docker-image-pin
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: Checks if Docker images are properly pinned in docker-compose.yml files
|
5
5
|
Project-URL: bugs, https://github.com/GideonBear/docker-image-pin/issues
|
6
6
|
Project-URL: homepage, https://github.com/GideonBear/docker-image-pin
|
@@ -0,0 +1,6 @@
|
|
1
|
+
docker_image_pin/__init__.py,sha256=Y8vBfdSubUm7jsJyhx-6irMIvvJ4heiTYar_VVVq-S0,2343
|
2
|
+
docker_image_pin-0.2.0.dist-info/METADATA,sha256=hL1JfVcZlAmNiT_gopjXcgISE_2iH6LujMAWpsFhO2o,626
|
3
|
+
docker_image_pin-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
4
|
+
docker_image_pin-0.2.0.dist-info/entry_points.txt,sha256=RTVvI_T4QdIwZqB1kR4g71CxE8_KeAgj2mmYBeRwok0,59
|
5
|
+
docker_image_pin-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
+
docker_image_pin-0.2.0.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
docker_image_pin/__init__.py,sha256=xq65hQDbFSTw7bjDqFV79nAYIC90oH79P02iDOhvj54,1926
|
2
|
-
docker_image_pin-0.1.1.dist-info/METADATA,sha256=OPxG2WgFfCcgpvSSjqXIce5_z9tRkNBuQOmzguAkBlo,626
|
3
|
-
docker_image_pin-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
4
|
-
docker_image_pin-0.1.1.dist-info/entry_points.txt,sha256=RTVvI_T4QdIwZqB1kR4g71CxE8_KeAgj2mmYBeRwok0,59
|
5
|
-
docker_image_pin-0.1.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
6
|
-
docker_image_pin-0.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|