Skip to content

Conversation

@mattsanta
Copy link
Contributor

chore: Upgrade dependencies - primarily addressing breaking changes in docker packages

Still WIP. Needs some dependencies to also address the breaking changes.

google/go-containerregistry#2160
buildpacks/pack#2470
buildpacks/imgutil#298

@mattsanta mattsanta requested a review from a team as a code owner December 1, 2025 18:25
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mattsanta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on upgrading various dependencies in the project, primarily to address breaking changes in Docker packages and to keep the project up-to-date with the latest library versions. The updates also include code modernization by migrating to the new Moby client, enhancing compatibility and stability.

Highlights

  • Dependency Upgrades: This PR upgrades several Go dependencies, including cloud.google.com/go/storage, github.com/docker/cli, github.com/moby/buildkit, golang.org/x/crypto, and Kubernetes-related libraries.
  • Docker Package Changes: The updates primarily address breaking changes in Docker packages, ensuring compatibility and stability.
  • Kubernetes Library Updates: Several Kubernetes libraries such as k8s.io/api, k8s.io/apimachinery, and k8s.io/kubectl have been updated to version v0.34.2.
  • Indirect Dependency Updates: Indirect dependencies like cel.dev/expr, cloud.google.com/go/spanner, github.com/aws/aws-sdk-go-v2, and others have been updated to their latest versions.
  • Code Modernization: The code has been updated to use the new Moby client instead of the deprecated Docker client.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades a significant number of dependencies, most notably migrating from the docker/docker client to the moby/moby client. While most of the changes correctly adapt to the new APIs, I've found several issues related to incorrect API usage with the new Moby client, which will lead to compilation errors or incorrect behavior. These issues are primarily in pkg/skaffold/docker/image.go and need to be addressed. I've also pointed out some incorrect struct field access in the integration tests due to the API changes.

// Delete stops, removes, and prunes a running container
func (l *localDaemon) Delete(ctx context.Context, out io.Writer, id string) error {
if err := l.apiClient.ContainerStop(ctx, id, container.StopOptions{}); err != nil {
if _, err := l.apiClient.ContainerStop(ctx, id, client.ContainerStopOptions{}); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The ContainerStop function from the Moby client returns only an error. Using a blank identifier _ for a non-existent return value will cause a compilation error.

Suggested change
if _, err := l.apiClient.ContainerStop(ctx, id, client.ContainerStopOptions{}); err != nil {
if err := l.apiClient.ContainerStop(ctx, id, client.ContainerStopOptions{}); err != nil {

log.Entry(ctx).Debugf("unable to stop running container: %s", err.Error())
}
if err := l.apiClient.ContainerRemove(ctx, id, container.RemoveOptions{}); err != nil {
if _, err := l.apiClient.ContainerRemove(ctx, id, client.ContainerRemoveOptions{}); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The ContainerRemove function from the Moby client returns only an error. Using a blank identifier _ for a non-existent return value will cause a compilation error.

Suggested change
if _, err := l.apiClient.ContainerRemove(ctx, id, client.ContainerRemoveOptions{}); err != nil {
if err := l.apiClient.ContainerRemove(ctx, id, client.ContainerRemoveOptions{}); err != nil {


func (l *localDaemon) NetworkRemove(ctx context.Context, name string) error {
return l.apiClient.NetworkRemove(ctx, name)
_, err := l.apiClient.NetworkRemove(ctx, name, client.NetworkRemoveOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The NetworkRemove function in the Moby client returns only an error and does not accept client.NetworkRemoveOptions. The blank identifier _ and the options argument are incorrect and will cause a compilation error.

Suggested change
_, err := l.apiClient.NetworkRemove(ctx, name, client.NetworkRemoveOptions{})
return l.apiClient.NetworkRemove(ctx, name)

Comment on lines +557 to +559
if _, err := l.apiClient.ImageTag(ctx, client.ImageTagOptions{Source: image, Target: ref}); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The ImageTag function in the Moby client expects source and target strings as arguments, not an options struct. This will cause a compilation error.

return l.apiClient.ImageTag(ctx, image, ref)

so.Timeout = util.Ptr[int](int(stopTimeout.Seconds()))
}
if err := l.apiClient.ContainerStop(ctx, id, so); err != nil {
if _, err := l.apiClient.ContainerStop(ctx, id, so); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The ContainerStop function from the Moby client returns only an error. Using a blank identifier _ for a non-existent return value will cause a compilation error.

if err := l.apiClient.ContainerStop(ctx, id, so); err != nil {


func (l *localDaemon) Remove(ctx context.Context, id string) error {
if err := l.apiClient.ContainerRemove(ctx, id, container.RemoveOptions{}); err != nil {
if _, err := l.apiClient.ContainerRemove(ctx, id, client.ContainerRemoveOptions{}); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The ContainerRemove function from the Moby client returns only an error. Using a blank identifier _ for a non-existent return value will cause a compilation error.

if err := l.apiClient.ContainerRemove(ctx, id, client.ContainerRemoveOptions{}); err != nil {

Comment on lines +149 to +159
containers, err := dockerclient.ContainerList(context.Background(), client.ContainerListOptions{All: true})
if err != nil {
t.Fail()
}
time.Sleep(sleepTime)
if len(containers) == 0 {
if len(containers.Items) == 0 {
continue
}

checkEntrypointRewrite(containers, &verifyEntrypointRewrite)
checkSupportContainer(containers, &verifySupportContainer)
checkEntrypointRewrite(containers.Items, &verifyEntrypointRewrite)
checkSupportContainer(containers.Items, &verifySupportContainer)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The result of ContainerList from the new Moby client is a struct that contains the list of containers in the Items field. The code needs to be updated to access this field to get the list of containers.

Suggested change
containers, err := dockerclient.ContainerList(context.Background(), client.ContainerListOptions{All: true})
if err != nil {
t.Fail()
}
time.Sleep(sleepTime)
if len(containers) == 0 {
if len(containers.Items) == 0 {
continue
}
checkEntrypointRewrite(containers, &verifyEntrypointRewrite)
checkSupportContainer(containers, &verifySupportContainer)
checkEntrypointRewrite(containers.Items, &verifyEntrypointRewrite)
checkSupportContainer(containers.Items, &verifySupportContainer)
containers, err := dockerclient.ContainerList(context.Background(), client.ContainerListOptions{All: true})
if err != nil {
t.Fail()
}
time.Sleep(sleepTime)
if len(containers.Items) == 0 {
continue
}
checkEntrypointRewrite(containers.Items, &verifyEntrypointRewrite)
checkSupportContainer(containers.Items, &verifySupportContainer)

Comment on lines +488 to 493
if cInfo.Container.State.Running {
containersRunning++
}

if cInfo.State.Dead || cInfo.State.Restarting {
if cInfo.Container.State.Dead || cInfo.Container.State.Restarting {
return false, fmt.Errorf("container %v is in dead or restarting state", cn)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The ContainerInspect function returns a types.ContainerJSON object which has a State field directly. Accessing State via a Container field is incorrect and will fail. It should be cInfo.State.

Suggested change
if cInfo.Container.State.Running {
containersRunning++
}
if cInfo.State.Dead || cInfo.State.Restarting {
if cInfo.Container.State.Dead || cInfo.Container.State.Restarting {
return false, fmt.Errorf("container %v is in dead or restarting state", cn)
if cInfo.State != nil && cInfo.State.Running {
containersRunning++
}
if cInfo.State != nil && (cInfo.State.Dead || cInfo.State.Restarting) {
return false, fmt.Errorf("container %v is in dead or restarting state", cn)
}

return nil, errors.Wrap(err, "inspecting init container")
}
if len(r.Mounts) != 1 {
if len(r.Container.Mounts) != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The result of ContainerInspect is a types.ContainerJSON object which has a Mounts field directly. Accessing Mounts via a Container field is incorrect. It should be r.Mounts.

Suggested change
if len(r.Container.Mounts) != 1 {
if len(r.Mounts) != 1 {

return err
}
if r.Warning != "" {
if len(r.Warning) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This condition appears to be inverted. It logs a warning if r.Warning is empty. It should likely log a warning when r.Warning is not empty.

Suggested change
if len(r.Warning) == 0 {
if len(r.Warning) > 0 {

dependabot bot and others added 4 commits December 1, 2025 18:41
…rTools#9917)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0.
- [Commits](golang/crypto@v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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