Skip to content

Enable docker api client by default #2417

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

Merged
merged 3 commits into from
Jun 25, 2025
Merged

Conversation

michaeldwan
Copy link
Member

@michaeldwan michaeldwan commented Jun 18, 2025

Switches the default docker client to the new one introduced in #2327. It's been available for about a month by calling with COG_DOCKER_SDK_CLIENT=1.

No show-stopping issues came up through internal testing or integration tests on CI, but if anything does arise users can revert to the previous behavior by running with COG_DOCKER_SDK_CLIENT=0, such as:

COG_DOCKER_SDK_CLIENT=0 cog build ...

@michaeldwan michaeldwan requested review from a team and Copilot June 18, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR switches the default Docker client from the CLI to the new API client, streamlining the experience by enabling it by default unless overridden.

  • Switches client selection logic to use util.GetEnvOrDefault with a default true value
  • Removes the direct dependency on the os package for environment variable lookup
Comments suppressed due to low confidence (1)

pkg/docker/docker.go:13

  • Consider adding unit tests to verify that the client selection logic based on the 'COG_DOCKER_SDK_CLIENT' environment variable behaves as expected when not explicitly set and when set to false.
	if !util.GetEnvOrDefault("COG_DOCKER_SDK_CLIENT", true, strconv.ParseBool) {

@michaeldwan michaeldwan force-pushed the mb/enable-docker-api-client branch from 74df2d8 to 55fb019 Compare June 18, 2025 20:18
@michaeldwan michaeldwan marked this pull request as draft June 18, 2025 21:45
@michaeldwan michaeldwan mentioned this pull request Jun 19, 2025
fallback to cli with COG_DOCKER_SDK_CLIENT=0
@michaeldwan michaeldwan force-pushed the mb/enable-docker-api-client branch from 9756c54 to 9ae4493 Compare June 20, 2025 19:18
@michaeldwan michaeldwan marked this pull request as ready for review June 24, 2025 20:30
Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

🚢

@michaeldwan michaeldwan merged commit b6f67fc into main Jun 25, 2025
26 checks passed
@michaeldwan michaeldwan deleted the mb/enable-docker-api-client branch June 25, 2025 00:15
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