lennybot 1.0.24__tar.gz → 1.0.28__tar.gz
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.
- {lennybot-1.0.24 → lennybot-1.0.28}/PKG-INFO +1 -1
- {lennybot-1.0.24 → lennybot-1.0.28}/requirements.txt +1 -1
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/check/docker_image_available.py +15 -3
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/config/config.py +16 -3
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/plan.py +14 -2
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/PKG-INFO +1 -1
- {lennybot-1.0.24 → lennybot-1.0.28}/test/test_docker_image_available.py +9 -3
- lennybot-1.0.28/version.txt +1 -0
- lennybot-1.0.24/version.txt +0 -1
- {lennybot-1.0.24 → lennybot-1.0.28}/LICENSE +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/README.md +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/pyproject.toml +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/setup.cfg +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/setup.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/__main__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/download_resources.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/iaction.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/remove_checksums.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/update_dockerfile.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/update_image_tag.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/actions/update_yaml.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/check/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/check/icheck.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/config/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/helper/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/lennybot.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/model/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/model/plan.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/model/state.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/apply.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/github.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/source/__init__.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/source/isource.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/source/source_github.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot/service/source/source_github_query.py +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/SOURCES.txt +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/dependency_links.txt +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/entry_points.txt +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/requires.txt +0 -0
- {lennybot-1.0.24 → lennybot-1.0.28}/src/lennybot.egg-info/top_level.txt +0 -0
|
@@ -103,7 +103,11 @@ class DockerImageAvailableCheck(ICheck):
|
|
|
103
103
|
+ image_tag
|
|
104
104
|
)
|
|
105
105
|
return DockerImage(match.group(4), match.group(5) + "/" + match.group(6), image_tag)
|
|
106
|
-
return DockerImage(
|
|
106
|
+
return DockerImage(
|
|
107
|
+
match.group(7),
|
|
108
|
+
match.group(8) + "/" + match.group(9) + "/" + match.group(10),
|
|
109
|
+
image_tag,
|
|
110
|
+
)
|
|
107
111
|
|
|
108
112
|
def _authenticate_on_registry(self, registry: str, authentication_header: WwwAuthenticateHeader) -> str:
|
|
109
113
|
params = {
|
|
@@ -143,11 +147,19 @@ class DockerImageAvailableCheck(ICheck):
|
|
|
143
147
|
return str(access_token)
|
|
144
148
|
|
|
145
149
|
if response.status_code == 401:
|
|
146
|
-
logging.error(
|
|
150
|
+
logging.error(
|
|
151
|
+
"Authentication failed: %d with %s",
|
|
152
|
+
response.status_code,
|
|
153
|
+
response.headers,
|
|
154
|
+
)
|
|
147
155
|
raise Exception("Error occurred: Unauthenticated: ", response.status_code)
|
|
148
156
|
|
|
149
157
|
if response.status_code == 403:
|
|
150
|
-
logging.error(
|
|
158
|
+
logging.error(
|
|
159
|
+
"Authorization failed: %d with %s",
|
|
160
|
+
response.status_code,
|
|
161
|
+
response.headers,
|
|
162
|
+
)
|
|
151
163
|
raise Exception("Error occurred: Unauthorization: ", response.status_code)
|
|
152
164
|
|
|
153
165
|
if response.status_code == 404:
|
|
@@ -26,7 +26,13 @@ CONFIGURATION_OPTIONS = {
|
|
|
26
26
|
},
|
|
27
27
|
"logging": {
|
|
28
28
|
"type": "object",
|
|
29
|
-
"properties": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"level": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"required": False,
|
|
33
|
+
"attribute": "_logging_level",
|
|
34
|
+
}
|
|
35
|
+
},
|
|
30
36
|
},
|
|
31
37
|
"container": {
|
|
32
38
|
"type": "object",
|
|
@@ -56,7 +62,11 @@ CONFIGURATION_OPTIONS = {
|
|
|
56
62
|
"attribute": "_source",
|
|
57
63
|
"properties": {
|
|
58
64
|
"type": {"type": "string", "required": True, "attribute": "_type"},
|
|
59
|
-
"repository": {
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"required": True,
|
|
68
|
+
"attribute": "_repository",
|
|
69
|
+
},
|
|
60
70
|
"regex": {"type": "string", "attribute": "_regex"},
|
|
61
71
|
},
|
|
62
72
|
},
|
|
@@ -259,7 +269,10 @@ class LennyBotConfig:
|
|
|
259
269
|
|
|
260
270
|
def _configure_logging(self):
|
|
261
271
|
logging_level = logging._nameToLevel.get(self._logging_level, logging.DEBUG)
|
|
262
|
-
logging.basicConfig(
|
|
272
|
+
logging.basicConfig(
|
|
273
|
+
level=logging_level,
|
|
274
|
+
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
|
275
|
+
)
|
|
263
276
|
self._log = logging.getLogger(self.__class__.__name__)
|
|
264
277
|
self._log.debug("Logging was configured")
|
|
265
278
|
|
|
@@ -31,7 +31,13 @@ class LennyBotApplication:
|
|
|
31
31
|
self._current_version = state.current_version(self._name)
|
|
32
32
|
self._latest_version = self._source.latest_version()
|
|
33
33
|
for config in self._config._checks:
|
|
34
|
-
check = create_check(
|
|
34
|
+
check = create_check(
|
|
35
|
+
self.name,
|
|
36
|
+
self._current_version,
|
|
37
|
+
self._latest_version,
|
|
38
|
+
config,
|
|
39
|
+
self._global_config,
|
|
40
|
+
)
|
|
35
41
|
self._checks.append(check)
|
|
36
42
|
|
|
37
43
|
def should_update(self) -> bool:
|
|
@@ -47,7 +53,13 @@ class LennyBotApplication:
|
|
|
47
53
|
|
|
48
54
|
for check in self._checks:
|
|
49
55
|
if not check.check():
|
|
50
|
-
self._log.
|
|
56
|
+
self._log.warning(
|
|
57
|
+
"Check '%s' failed for application '%s' with current version '%s' and latest version '%s'",
|
|
58
|
+
check.__class__.__name__,
|
|
59
|
+
self.name,
|
|
60
|
+
self._current_version,
|
|
61
|
+
self._latest_version,
|
|
62
|
+
)
|
|
51
63
|
return False
|
|
52
64
|
return True
|
|
53
65
|
|
|
@@ -54,7 +54,9 @@ class TestAuthenticateImage(unittest.TestCase):
|
|
|
54
54
|
def test_authenticate_on_registry_returns_access_token(self):
|
|
55
55
|
registry = LennyBotConfigContainerRegistry("hub.docker.io")
|
|
56
56
|
header_value = WwwAuthenticateHeader(
|
|
57
|
-
"https://docker-auth.elastic.co/auth",
|
|
57
|
+
"https://docker-auth.elastic.co/auth",
|
|
58
|
+
"repository:beats/filebeat:pull",
|
|
59
|
+
"token-service",
|
|
58
60
|
)
|
|
59
61
|
access_token = self.docker_image_check._authenticate_on_registry(registry.name, header_value)
|
|
60
62
|
self.assertIsNotNone(access_token)
|
|
@@ -62,7 +64,9 @@ class TestAuthenticateImage(unittest.TestCase):
|
|
|
62
64
|
def test_authenticate_without_credentials_in_config(self):
|
|
63
65
|
self.config._image_pattern = "quay.io/argoproj/argocd:v{{version}}"
|
|
64
66
|
header_value = WwwAuthenticateHeader(
|
|
65
|
-
"https://quay.io/v2/auth",
|
|
67
|
+
"https://quay.io/v2/auth",
|
|
68
|
+
"repository:argoproj/argocd:pull",
|
|
69
|
+
"token-service",
|
|
66
70
|
)
|
|
67
71
|
access_token = self.docker_image_check._authenticate_on_registry("", header_value)
|
|
68
72
|
self.assertIsNotNone(access_token)
|
|
@@ -74,7 +78,9 @@ class TestAuthenticateImage(unittest.TestCase):
|
|
|
74
78
|
registry._password = "1234"
|
|
75
79
|
self.container_config._registries["ghcr.io"] = registry
|
|
76
80
|
header_value = WwwAuthenticateHeader(
|
|
77
|
-
"https://ghcr.io/v2/auth",
|
|
81
|
+
"https://ghcr.io/v2/auth",
|
|
82
|
+
"repository:brose-ebike/postgres-operator:pull",
|
|
83
|
+
"token-service",
|
|
78
84
|
)
|
|
79
85
|
|
|
80
86
|
with self.assertRaises(Exception) as context:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.28
|
lennybot-1.0.24/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.24
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|