docker-stack 2.0.3__tar.gz → 2.0.5__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.
Files changed (31) hide show
  1. {docker_stack-2.0.3 → docker_stack-2.0.5}/PKG-INFO +1 -1
  2. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/cli.py +3 -2
  3. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/manager_api.py +10 -1
  4. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/PKG-INFO +1 -1
  5. {docker_stack-2.0.3 → docker_stack-2.0.5}/setup.py +1 -1
  6. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_docker_stack.py +4 -4
  7. {docker_stack-2.0.3 → docker_stack-2.0.5}/README.md +0 -0
  8. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/__init__.py +0 -0
  9. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/command_runner.py +0 -0
  10. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/compose.py +0 -0
  11. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/docker_objects.py +0 -0
  12. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/envsubst.py +0 -0
  13. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/envsubst_merge.py +0 -0
  14. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/helpers.py +0 -0
  15. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/login.py +0 -0
  16. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/markers.py +0 -0
  17. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/merge_conf.py +0 -0
  18. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/registry.py +0 -0
  19. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack/url_parser.py +0 -0
  20. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/SOURCES.txt +0 -0
  21. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/dependency_links.txt +0 -0
  22. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/entry_points.txt +0 -0
  23. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/requires.txt +0 -0
  24. {docker_stack-2.0.3 → docker_stack-2.0.5}/docker_stack.egg-info/top_level.txt +0 -0
  25. {docker_stack-2.0.3 → docker_stack-2.0.5}/pyproject.toml +0 -0
  26. {docker_stack-2.0.3 → docker_stack-2.0.5}/setup.cfg +0 -0
  27. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_docker_objects.py +0 -0
  28. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_load_env.py +0 -0
  29. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_login.py +0 -0
  30. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_manager_api.py +0 -0
  31. {docker_stack-2.0.3 → docker_stack-2.0.5}/tests/test_node_ls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docker-stack
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: CLI for deploying and managing Docker stacks.
5
5
  Home-page: https://github.com/mesudip/docker-stack
6
6
  Author: Sudip Bhattarai
@@ -329,12 +329,13 @@ class DockerStack:
329
329
  docker_object_name = docker_object_name_for(name, explicit_name=explicit_name)
330
330
 
331
331
  if manager_client and stack:
332
+ manager_object_name = explicit_name or name
332
333
  label_map = normalize_labels(labels)
333
334
  if manager.object_type == "config":
334
335
  response = manager_client.resolve_config(
335
336
  stack=stack,
336
337
  namespace=namespace,
337
- name=docker_object_name,
338
+ name=manager_object_name,
338
339
  content=data,
339
340
  labels=label_map,
340
341
  )
@@ -342,7 +343,7 @@ class DockerStack:
342
343
  response = manager_client.resolve_secret(
343
344
  stack=stack,
344
345
  namespace=namespace,
345
- name=docker_object_name,
346
+ name=manager_object_name,
346
347
  content=None if is_generated_secret else data,
347
348
  generate=generate_options if is_generated_secret else None,
348
349
  labels=label_map,
@@ -110,7 +110,16 @@ class ManagerApiClient:
110
110
  with urllib.request.urlopen(request, timeout=self.timeout_secs, context=context) as response:
111
111
  return json.loads(response.read().decode("utf-8"))
112
112
  except urllib.error.HTTPError as exc:
113
- raise RuntimeError(f"Manager request failed ({method} {path}): HTTP {exc.code}") from exc
113
+ body = ""
114
+ try:
115
+ payload = exc.read().decode("utf-8", errors="replace").strip()
116
+ if payload:
117
+ body = f": {payload}"
118
+ except Exception:
119
+ body = ""
120
+ raise RuntimeError(
121
+ f"Manager request failed ({method} {path}): HTTP {exc.code}{body}"
122
+ ) from exc
114
123
  except urllib.error.URLError as exc:
115
124
  raise RuntimeError(f"Manager request failed ({method} {path}): {exc.reason}") from exc
116
125
  except json.JSONDecodeError as exc:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docker-stack
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: CLI for deploying and managing Docker stacks.
5
5
  Home-page: https://github.com/mesudip/docker-stack
6
6
  Author: Sudip Bhattarai
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="docker-stack",
5
- version="2.0.3",
5
+ version="2.0.5",
6
6
  description="CLI for deploying and managing Docker stacks.",
7
7
  long_description=open("README.md").read(), # You can include a README file to describe your package
8
8
  long_description_content_type="text/markdown",
@@ -229,7 +229,7 @@ def test_process_x_content_uses_manager_resolve_apis(monkeypatch):
229
229
  {
230
230
  "stack": "govtool",
231
231
  "namespace": "default",
232
- "name": "govtool_app.conf",
232
+ "name": "app.conf",
233
233
  "content": "hello",
234
234
  "labels": {},
235
235
  }
@@ -238,7 +238,7 @@ def test_process_x_content_uses_manager_resolve_apis(monkeypatch):
238
238
  {
239
239
  "stack": "govtool",
240
240
  "namespace": "default",
241
- "name": "govtool_app-secret",
241
+ "name": "app-secret",
242
242
  "content": None,
243
243
  "generate": {
244
244
  "length": 24,
@@ -250,8 +250,8 @@ def test_process_x_content_uses_manager_resolve_apis(monkeypatch):
250
250
  "return_generated_value": True,
251
251
  }
252
252
  ]
253
- assert processed_configs == {"app.conf": {"name": "govtool_app.conf_v2", "external": True}}
254
- assert processed_secrets == {"app-secret": {"name": "govtool_app-secret", "external": True}}
253
+ assert processed_configs == {"app.conf": {"name": "app.conf_v2", "external": True}}
254
+ assert processed_secrets == {"app-secret": {"name": "app-secret", "external": True}}
255
255
  assert docker.stack.generated_secrets == {"app-secret": "generated-from-manager"}
256
256
 
257
257
 
File without changes
File without changes