Skip to content

Conversation

@nterbogt
Copy link
Contributor

@nterbogt nterbogt commented Dec 4, 2025

Refactor skpr package and skpr pull to use a replaceable docker client. Implement an experimental config to switch between implementations. Set the default implementation to the existing go client.

Add the following to your configuration to test it.

experimental:
  docker-client: docker

@nterbogt nterbogt changed the base branch from main to package-no-push-no-auth December 4, 2025 07:02
Base automatically changed from package-no-push-no-auth to main December 4, 2025 23:44
@nterbogt nterbogt force-pushed the official-docker-client-build branch from 6d29011 to 6fb9f3d Compare December 5, 2025 00:06

// See if we're using default builder.
userConfig, _ := user.NewClient()
featureFlags, _ := userConfig.LoadFeatureFlags()
Copy link
Contributor

Choose a reason for hiding this comment

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

We've already loaded the feature flags up in the main.go

The client feature flag could get passed down into this NewCommand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did look at that... but found that every single function in userConfig does a .load(). That .load() isn't cached and reads the file every time. So I figured I wouldn't add in the complexity of passing it through all the way. But I'll update it.


func NewClientFromUserConfig(auth auth.Auth) (DockerClient, error) {
// See if we're using default builder.
userConfig, _ := user.NewClient()
Copy link
Contributor

@nickschuch nickschuch Dec 16, 2025

Choose a reason for hiding this comment

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

Errors aren't being handled.

I also think the name of the client should be passed in vs loaded multiple times. This set of packages doesn't have to be tightly coupled to the feature flags.

Copy link
Contributor Author

@nterbogt nterbogt Dec 16, 2025

Choose a reason for hiding this comment

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

Ignoring the errors was intentional. The config is only needed if it exists, if it has a docker-client setting and if that setting is a valid option... otherwise it uses the default. So if the config fails to load, we use the defaults.

But I guess it doesn't matter cause main.go throws error if it fails to load.

@nterbogt nterbogt force-pushed the official-docker-client-build branch from 6fb9f3d to 6975b8a Compare December 16, 2025 20:10
@nickschuch nickschuch merged commit 965eea3 into main Dec 18, 2025
2 checks passed
@nickschuch nickschuch deleted the official-docker-client-build branch December 18, 2025 22:44
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.

3 participants