Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make context orchestrator field optional #2578

Merged
merged 2 commits into from Jun 2, 2020

Conversation

aiordache
Copy link
Collaborator

Signed-off-by: aiordache anca.iordache@docker.com

When loading a context without the StackOrchestrator field set, we get an error.

Traceback (most recent call last):
  File "main.py", line 64, in <module>
    test_get_docker_context()
  File "main.py", line 34, in test_get_docker_context
    ctx = ContextAPI.get_context("dev")
  File "/src/github.com/docker/docker-py/docker/context/api.py", line 97, in get_context
    return Context.load_context(name)
  File "/src/github.com/docker/docker-py/docker/context/context.py", line 62, in load_context
    name, orchestrator, endpoints = Context._load_meta(name)
  File "/src/github.com/docker/docker-py/docker/context/context.py", line 88, in _load_meta
    metadata["Name"], metadata["Metadata"]["StackOrchestrator"],
KeyError: 'StackOrchestrator'

Made this field optional so it won't raise error on load.

Signed-off-by: aiordache <anca.iordache@docker.com>
@aiordache aiordache changed the title Make orchestrator field optional Make context orchestrator field optional Jun 2, 2020
Signed-off-by: aiordache <anca.iordache@docker.com>
Copy link
Collaborator

@ulyssessouza ulyssessouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ulyssessouza ulyssessouza merged commit a527086 into docker:master Jun 2, 2020
@ulyssessouza ulyssessouza added this to the 4.2.1 milestone Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants