Skip to content

[docker] Context.TLSConfig can return None - #16871

Open
ArthDubey1011 wants to merge 1 commit into
python:mainfrom
ArthDubey1011:none-docker
Open

ArthDubey1011 wants to merge 1 commit into
python:mainfrom
ArthDubey1011:none-docker

Conversation

@ArthDubey1011

@ArthDubey1011 ArthDubey1011 commented Nov 19, 2026 •

Copy link
Copy Markdown

Context.TLSConfig returns None when the context has no TLS configuration for its orchestrator's endpoint (source):

@property

def TLSConfig(self):

    key = self.orchestrator

    if not key or key == "swarm":

        key = "docker"

    if key in self.tls_cfg.keys():

        return self.tls_cfg[key]

    return None

That is the default for a context created without tls_cfg. Checked with docker 7.2.0:

>>> from docker.context import Context

>>> print(Context("x").TLSConfig)

None

AI assistance: Claude Code (Claude Opus 5.5) found this by comparing the stubs with the runtime source, ran the check above and made the edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant