gowalk-cicd 1.0.196 → 1.0.197
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.
|
@@ -5,6 +5,7 @@ import re
|
|
|
5
5
|
import subprocess
|
|
6
6
|
|
|
7
7
|
from runtime_healthcheck import bounded_tmpfs, cache_healthcheck
|
|
8
|
+
from runtime_model import escape_interpolation
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
def eligible(service):
|
|
@@ -17,7 +18,14 @@ def eligible(service):
|
|
|
17
18
|
def image_health(command, name, service):
|
|
18
19
|
reference = service.get('image')
|
|
19
20
|
if not reference:
|
|
20
|
-
|
|
21
|
+
resolver = list(command)
|
|
22
|
+
option = next((flag for flag in ('--file', '-f') if flag in resolver), None)
|
|
23
|
+
if option:
|
|
24
|
+
resolver[resolver.index(option) + 1] = '-'
|
|
25
|
+
else:
|
|
26
|
+
resolver.extend(['--file', '-'])
|
|
27
|
+
selected = {'services': {name: {'build': '.'}}}
|
|
28
|
+
result = subprocess.run(resolver + ['config', '--images', name], input=json.dumps(selected),
|
|
21
29
|
capture_output=True, text=True, timeout=30, check=True)
|
|
22
30
|
references = result.stdout.split()
|
|
23
31
|
if len(references) != 1:
|
|
@@ -44,6 +52,7 @@ def inherit_healthchecks(model, command):
|
|
|
44
52
|
candidate = copy.deepcopy(service)
|
|
45
53
|
candidate.setdefault('healthcheck', {})['test'] = health['Test']
|
|
46
54
|
if cache_healthcheck(candidate):
|
|
55
|
+
candidate['healthcheck']['test'] = escape_interpolation(candidate['healthcheck']['test'])
|
|
47
56
|
service['healthcheck'] = candidate['healthcheck']
|
|
48
57
|
service.update(image=image['Id'], pull_policy='never')
|
|
49
58
|
changed = True
|
|
@@ -36,6 +36,10 @@ wraps only a missing Compose test, retaining explicit timing and disabled/custom
|
|
|
36
36
|
launch model pins the transformed service to that inspected image ID with pulling disabled, so a
|
|
37
37
|
moving tag cannot substitute another image's healthcheck. Explicit registry-refresh policies and
|
|
38
38
|
non-build services retain their existing image/pull behavior. No pre-build image healthcheck is reused.
|
|
39
|
+
Imported image commands escape literal dollars once at the Compose boundary, preserving Python
|
|
40
|
+
strings and container-shell expansion without interpreting them against the deployment host environment.
|
|
41
|
+
Default image names resolve from an isolated service model with the same Compose project name;
|
|
42
|
+
dependency images cannot make that selection ambiguous.
|
|
39
43
|
|
|
40
44
|
## Adopt an existing API
|
|
41
45
|
|