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

Add fields 'platforms' and 'status' to Builder. #357

Merged
merged 4 commits into from
Jul 23, 2022
Merged

Add fields 'platforms' and 'status' to Builder. #357

merged 4 commits into from
Jul 23, 2022

Conversation

MisterOwlPT
Copy link
Contributor

Consider the following example output:

$ docker buildx inspect default
Name:   default
Driver: docker

Nodes:
Name:      default
Endpoint:  default
Status:    running
Platforms: linux/amd64, linux/arm64

I am using python_on_whales on a project and needed to access the values of fields status and platforms.
However, I was only able to access the values of fields name and driver.

With the proposed changes, the following is now possible:

>>> from python_on_whales import docker
>>> builder = docker.buildx.inspect('default')
>>> builder.platforms
['linux/amd64', 'linux/arm64']
>>> builder.status
'running'

In case no platform data is provided the field platforms assumes value [] .

Updated unit tests to consider the proposed changes.

@gabrieldemarmiesse
Copy link
Owner

gabrieldemarmiesse commented Jul 22, 2022

Thank you very much! I wish docker buildx had some json formatting options. But until then, splitting it is.

Note that you might need to use some linting for the PR to pass.

docker/buildx#381 was opened and docker/buildx#830 was created to fix it, but it seems it's staled.

@MisterOwlPT
Copy link
Contributor Author

I run isort and fixed the imports formatting.
PR should pass now.

@gabrieldemarmiesse gabrieldemarmiesse enabled auto-merge (squash) July 23, 2022 11:20
@gabrieldemarmiesse gabrieldemarmiesse merged commit e857d24 into gabrieldemarmiesse:master Jul 23, 2022
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.

2 participants