Skip to content

Conversation

@mdelapenya
Copy link
Member

What does this PR do?

It sets the current modifier as the modifier if the original one was nil

Why is it important?

Avoid errors and simplify initialisation in client code

Copilot AI review requested due to automatic review settings October 22, 2025 14:36
@mdelapenya mdelapenya added the bug Something isn't working label Oct 22, 2025
@mdelapenya mdelapenya self-assigned this Oct 22, 2025
Copy link
Contributor

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 modifies the WithAdditional*Modifier functions to handle nil original modifiers instead of returning an error. When the original modifier is nil, the new modifier is now directly applied rather than treating it as an error condition.

Key changes:

  • Removed error returns when original modifiers are nil
  • Added nil checks to apply the new modifier directly when no original exists
  • Added test coverage for the nil original modifier scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
container/options.go Updated three WithAdditional*Modifier functions to handle nil original modifiers by applying only the new modifier
container/options_test.go Added "nil-original" test cases for each of the three modifier functions to verify the new behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mdelapenya mdelapenya merged commit 10befeb into docker:main Oct 22, 2025
11 checks passed
@mdelapenya mdelapenya deleted the fix-nil-config-modifier branch October 22, 2025 18:05
mdelapenya added a commit to ndeloof/go-sdk that referenced this pull request Nov 6, 2025
* main:
  feat(wait): add human-readable String() methods to all wait strategies (docker#119)
  feat(image): display formatted pull progress on Windows terminals (docker#118)
  chore(release): add Go proxy refresh automation (docker#117)
  chore(release): bump module versions
  chore(release): prevent for pushing to personal forks (docker#115)
  chore(release): add pre-release checks to make the release process more consistent (docker#114)
  chore(volume): return pointer in FindByID (docker#105)
  fix(container): proper error message on empty container names (docker#113)
  fix(container): add to nil modifiers (docker#112)
  feat(container): add new functional options to add container config, hostConfig and endpointSettings (docker#111)
  feat(container): configure pull handler at container creation (docker#110)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant