docker-stack 2.0.6__tar.gz → 2.0.7__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.
- {docker_stack-2.0.6 → docker_stack-2.0.7}/PKG-INFO +1 -1
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/cli.py +3 -9
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/PKG-INFO +1 -1
- {docker_stack-2.0.6 → docker_stack-2.0.7}/setup.py +1 -1
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_docker_stack.py +0 -27
- {docker_stack-2.0.6 → docker_stack-2.0.7}/README.md +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/__init__.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/command_runner.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/compose.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/docker_objects.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/envsubst.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/envsubst_merge.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/helpers.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/login.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/manager_api.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/markers.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/merge_conf.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/registry.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack/url_parser.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/SOURCES.txt +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/dependency_links.txt +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/entry_points.txt +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/requires.txt +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/docker_stack.egg-info/top_level.txt +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/pyproject.toml +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/setup.cfg +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_docker_objects.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_load_env.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_login.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_manager_api.py +0 -0
- {docker_stack-2.0.6 → docker_stack-2.0.7}/tests/test_node_ls.py +0 -0
|
@@ -433,12 +433,6 @@ class DockerStack:
|
|
|
433
433
|
@staticmethod
|
|
434
434
|
def _version_sort_key(raw: str):
|
|
435
435
|
return int(raw) if raw.isdigit() else raw
|
|
436
|
-
@staticmethod
|
|
437
|
-
def _display_stack_name(raw: str) -> str:
|
|
438
|
-
value = raw.strip()
|
|
439
|
-
if value.startswith("default--"):
|
|
440
|
-
return value[len("default--"):]
|
|
441
|
-
return value
|
|
442
436
|
|
|
443
437
|
def _print_stack_listing(self, stack_versions: Dict[str, List[str]]) -> None:
|
|
444
438
|
max_stack_name_length = max(len(stack) for stack in stack_versions) if stack_versions else 10
|
|
@@ -468,7 +462,7 @@ class DockerStack:
|
|
|
468
462
|
try:
|
|
469
463
|
payload = client.list_stacks()
|
|
470
464
|
stack_versions = {
|
|
471
|
-
|
|
465
|
+
str(item.get("stack")): [
|
|
472
466
|
str(version)
|
|
473
467
|
for version in (
|
|
474
468
|
item.get("versions")
|
|
@@ -494,7 +488,7 @@ class DockerStack:
|
|
|
494
488
|
parts = line.split("\t")
|
|
495
489
|
if len(parts) == 3 and "mesudip.stack.name" in parts[2]:
|
|
496
490
|
labels = {k: v for k, v in (label.split("=") for label in parts[2].split(",") if "=" in label)}
|
|
497
|
-
stack_name =
|
|
491
|
+
stack_name = labels.get("mesudip.stack.name")
|
|
498
492
|
version = labels.get("mesudip.object.version", "unknown")
|
|
499
493
|
|
|
500
494
|
if stack_name:
|
|
@@ -565,7 +559,7 @@ class DockerStack:
|
|
|
565
559
|
parts = line.split("\t")
|
|
566
560
|
if len(parts) == 2 and "mesudip.stack.name" in parts[1]:
|
|
567
561
|
labels = {k: v for k, v in (label.split("=") for label in parts[1].split(",") if "=" in label)}
|
|
568
|
-
stack =
|
|
562
|
+
stack = labels.get("mesudip.stack.name")
|
|
569
563
|
version = labels.get("mesudip.object.version", "unknown")
|
|
570
564
|
tag = labels.get("mesudip.stack.tag", "")
|
|
571
565
|
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="docker-stack",
|
|
5
|
-
version="2.0.
|
|
5
|
+
version="2.0.7",
|
|
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",
|
|
@@ -295,33 +295,6 @@ def test_rm_enqueues_stack_remove_command():
|
|
|
295
295
|
assert docker.stack.commands[-1].command == ["docker", "stack", "rm", "govtool"]
|
|
296
296
|
|
|
297
297
|
|
|
298
|
-
def test_default_namespace_stack_names_are_normalized_in_output(monkeypatch, capsys):
|
|
299
|
-
inspect_payloads = {
|
|
300
|
-
("docker", "config", "ls", "--format", "{{.ID}} {{.Name}} {{.Labels}}"):
|
|
301
|
-
"cfg1 default--team-a mesudip.stack.name=default--team-a,mesudip.object.version=1",
|
|
302
|
-
("docker", "config", "ls", "--format", "{{.Name}} {{.Labels}}"):
|
|
303
|
-
"default--team-a mesudip.stack.name=default--team-a,mesudip.object.version=1,mesudip.stack.tag=stable",
|
|
304
|
-
("docker", "config", "inspect", "team-a"):
|
|
305
|
-
json.dumps([{"Spec": {"Data": base64.b64encode(b"services:\n api:\n image: busybox\n").decode("utf-8")}}]),
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
def fake_run_cli_command(command, **kwargs):
|
|
309
|
-
key = tuple(command)
|
|
310
|
-
if key not in inspect_payloads:
|
|
311
|
-
raise AssertionError(f"Unexpected command: {command}")
|
|
312
|
-
return inspect_payloads[key]
|
|
313
|
-
|
|
314
|
-
monkeypatch.setattr("docker_stack.cli.run_cli_command", fake_run_cli_command)
|
|
315
|
-
monkeypatch.setattr("docker_stack.cli.discover_manager_client", lambda *_args, **_kwargs: None)
|
|
316
|
-
|
|
317
|
-
docker = Docker()
|
|
318
|
-
assert docker.stack.ls() == {"team-a": ["1"]}
|
|
319
|
-
assert docker.stack.versions("team-a") == [("1", "stable")]
|
|
320
|
-
output = capsys.readouterr().out
|
|
321
|
-
assert "default--team-a" not in output
|
|
322
|
-
assert "team-a" in output
|
|
323
|
-
|
|
324
|
-
|
|
325
298
|
def test_filtered_agent_outputs_still_render(monkeypatch, capsys):
|
|
326
299
|
inspect_payloads = {
|
|
327
300
|
("docker", "config", "ls", "--format", "{{.ID}}\t{{.Name}}\t{{.Labels}}"): "\n".join(
|
|
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
|