Skip to content

Conversation

@haytok
Copy link
Contributor

@haytok haytok commented Dec 20, 2025

In the current implementation, tests that require nerdtest.Build do not
run against the specified namespace when a private namespace is
configured.

For example, with the following requirements, the test runs in a private
namespace, but the internal logic of nerdtest.Build does not take the
private namespace into account, causing buildctl or buildkit to be
unavailable:

```
testCase.Require = require.All(
    nerdtest.Private,
    nerdtest.Build,
)
```

This commit fixes the behavior so that when a private namespace is
specified, tests are executed considering that namespace instead of the
default namespace.

Signed-off-by: Hayato Kiwata <[email protected]>
@haytok haytok force-pushed the issues_4613_compose_create_linux_test.go branch from 8ef1020 to 6c9bff0 Compare December 20, 2025 16:06
@AkihiroSuda AkihiroSuda added this to the v2.2.1 milestone Dec 21, 2025
@haytok
Copy link
Contributor Author

haytok commented Dec 21, 2025

Thank you for retrying the CI multiple times 🙏

@AkihiroSuda AkihiroSuda requested a review from a team December 21, 2025 18:23
@haytok haytok force-pushed the issues_4613_compose_create_linux_test.go branch from 6c9bff0 to 4a95d73 Compare December 22, 2025 12:27
@haytok haytok closed this Dec 22, 2025
@haytok haytok reopened this Dec 22, 2025
Copy link
Member

@ChengyuZhu6 ChengyuZhu6 left a comment

Choose a reason for hiding this comment

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

LGTM. Let's see if ci can be on green.

@haytok
Copy link
Contributor Author

haytok commented Dec 23, 2025

Hi, Hudson
Thank you for your review!

Upon checking the CI, I found that it had failed due to tests unrelated to this fix ... :(

Details

  • run 20433043835 / job 58707835229 : EL / almalinux-8 rootful
    image_convert_linux_test.go:132: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl image convert --soci --soci-span-size 2097152 --soci-min-layer-size 0  |
        |         | ghcr.io/stargz-containers/alpine:3.13-org testimageconvert-soci-converted-image-aceae1d3         |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🚫 command returned a non-zero exit code                                                         |
        +------------------------------------------------------------------------------------------------------------+
        |         | ⚠️ 1                                                                                             |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🟠 time="2025-12-22T13:36:37Z" level=info msg="Converting image from ghcr.io/stargz-containers/a |
        |         | lpine:3.13-org to docker.io/library/testimageconvert-soci-converted-image-aceae1d3:latest using  |
        |         | SOCI format"                                                                                     |
        |         | time="2025-12-22T13:36:39Z" level=info msg="soci: soci: errors encountered while building soci l |
        |         | ayers; cannot unmarshal existing ztoc: rpc error: code = NotFound desc = content digest sha256:3 |
        |         | 305435c3cfb133dcf92a6166b6df165dc99f67dee959f5b648e2f441538dc85: not found"                      |
        |         | time="2025-12-22T13:36:39Z" level=fatal msg="failed to convert image to SOCI format: exit status |
        |         |  1"                                                                                              |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | HOME=/root                                                                                       |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin                                                                                            |
        |         | DOCKER_CONFIG=/tmp/TestImageConvertsoci256882136/003                                             |
        |         | NERDCTL_TOML=/tmp/TestImageConvertsoci256882136/003/nerdctl.toml                                 |
        +------------------------------------------------------------------------------------------------------------+
        || 2.303114047s (limit: 3m0s)                                                                       |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestImageConvertsoci256882136/002                                                           |
        +------------------------------------------------------------------------------------------------------------+
        
    image_convert_linux_test.go:132: 	
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Command should succeed
        	👀 testing:		`command returned a non-zero exit code`
        	❌ FAILED!		is `<nil>`
        >>>>>>>>>>>>>>>>>>>>
  • run 20433043817 / job 58708133634 : in-container / rootful\n\n(old ubuntu)\n\n\n (ctd: v1.7.30)
    image_convert_linux_test.go:132: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl image convert --soci --all-platforms --soci-span-size 2097152 --soci-m |
        |         | in-layer-size 0 ghcr.io/stargz-containers/alpine:3.13-org testimageconvert-soci-with-all-platfor |
        |         | ms-converted-image-ada4def1                                                                      |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🚫 command returned a non-zero exit code                                                         |
        +------------------------------------------------------------------------------------------------------------+
        |         | ⚠️ 1                                                                                             |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🟠 time="2025-12-22T13:33:37Z" level=info msg="Converting image from ghcr.io/stargz-containers/a |
        |         | lpine:3.13-org to docker.io/library/testimageconvert-soci-with-all-platforms-converted-image-ada |
        |         | 4def1:latest using SOCI format"                                                                  |
        |         | time="2025-12-22T13:33:37Z" level=info msg="soci: soci: errors encountered while building soci l |
        |         | ayers; cannot unmarshal existing ztoc: rpc error: code = NotFound desc = content digest sha256:3 |
        |         | 305435c3cfb133dcf92a6166b6df165dc99f67dee959f5b648e2f441538dc85: not found"                      |
        |         | time="2025-12-22T13:33:37Z" level=fatal msg="failed to convert image to SOCI format: exit status |
        |         |  1"                                                                                              |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | HOME=/root                                                                                       |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin                                                                                            |
        |         | DOCKER_CONFIG=/tmp/TestImageConvertsoci_with_all-platforms454735179/003                          |
        |         | NERDCTL_TOML=/tmp/TestImageConvertsoci_with_all-platforms454735179/003/nerdctl.toml              |
        +------------------------------------------------------------------------------------------------------------+
        || <1s (limit: 3m0s)                                                                                |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestImageConvertsoci_with_all-platforms454735179/002                                        |
        +------------------------------------------------------------------------------------------------------------+
        
    image_convert_linux_test.go:132: 	
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Command should succeed
        	👀 testing:		`command returned a non-zero exit code`
        	❌ FAILED!		is `<nil>`
        >>>>>>>>>>>>>>>>>>>>
  • job 58708133648 : in-container / nerdctl.gomodjail < \nrootless
    container_run_test.go:169: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl.gomodjail ps -a                                                        |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🚫 command returned a non-zero exit code                                                         |
        +------------------------------------------------------------------------------------------------------------+
        |         | ⚠️ 1                                                                                             |
        +------------------------------------------------------------------------------------------------------------+
        |         | 🟠 time="2025-12-22T13:35:23Z" level=fatal msg="container \"e8142a2b404412639ed331c27bd6be0b1b9b |
        |         | 5f9ec23e2edfba6a1ebf85130ee1\" in namespace \"nerdctl-test\": not found"                         |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | XDG_SESSION_TYPE=tty                                                                             |
        |         | HOME=/home/rootless                                                                              |
        |         | XDG_SESSION_CLASS=user                                                                           |
        |         | XDG_SESSION_ID=3                                                                                 |
        |         | XDG_RUNTIME_DIR=/run/user/1001                                                                   |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin:/usr/games:/usr/local/games:/snap/bin                                                      |
        |         | DOCKER_CONFIG=/tmp/TestRunExitCode1452170239/003                                                 |
        |         | NERDCTL_TOML=/tmp/TestRunExitCode1452170239/003/nerdctl.toml                                     |
        +------------------------------------------------------------------------------------------------------------+
        || <1s (limit: 3m0s)                                                                                |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestRunExitCode1452170239/002                                                               |
        +------------------------------------------------------------------------------------------------------------+
        
    container_run_test.go:169: 	🔗 
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Command should succeed
        	👀 testing:		`command returned a non-zero exit code`
        	❌ FAILED!		is `<nil>`
        >>>>>>>>>>>>>>>>>>>>
  • job 58708133651 : in-container / rootful\n\n\n\n (canary)
    image_load_test.go:72: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl load                                                                   |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | HOME=/root                                                                                       |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin                                                                                            |
        |         | DOCKER_CONFIG=/tmp/TestLoadStdinFromPipe155662187/003                                            |
        |         | NERDCTL_TOML=/tmp/TestLoadStdinFromPipe155662187/003/nerdctl.toml                                |
        +------------------------------------------------------------------------------------------------------------+
        || <1s (limit: 3m0s)                                                                                |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestLoadStdinFromPipe155662187/002                                                          |
        +------------------------------------------------------------------------------------------------------------+
        
    image_load_test.go:72: 	🔗 
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Inspecting output (contains)
        	👀 testing:		``
        	❌ FAILED!		~= `testloadstdinfrompipe-56915bd1`
        >>>>>>>>>>>>>>>>>>>>
  • job 58708133658 : in-container / rootless
    image_load_test.go:116: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl load --quiet --input /tmp/TestLoadQuiet2698468150/001/04cb7b30/common. |
        |         | tar                                                                                              |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | XDG_SESSION_TYPE=tty                                                                             |
        |         | HOME=/home/rootless                                                                              |
        |         | XDG_SESSION_CLASS=user                                                                           |
        |         | XDG_SESSION_ID=3                                                                                 |
        |         | XDG_RUNTIME_DIR=/run/user/1001                                                                   |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin:/usr/games:/usr/local/games:/snap/bin                                                      |
        |         | DOCKER_CONFIG=/tmp/TestLoadQuiet2698468150/003                                                   |
        |         | NERDCTL_TOML=/tmp/TestLoadQuiet2698468150/003/nerdctl.toml                                       |
        +------------------------------------------------------------------------------------------------------------+
        || <1s (limit: 3m0s)                                                                                |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestLoadQuiet2698468150/002                                                                 |
        +------------------------------------------------------------------------------------------------------------+
        
    image_load_test.go:116: 	🔗 
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Inspecting output (contains)
        	👀 testing:		``
        	❌ FAILED!		~= `testloadquiet-2c34801a`
        >>>>>>>>>>>>>>>>>>>>
  • job 58708133668 : in-container / rootless-port-slirp4netns
    image_load_test.go:72: 
        
        +------------------------------------------------------------------------------------------------------------+
        | ➡️      | ⚙️ /usr/local/bin/nerdctl load                                                                   |
        +------------------------------------------------------------------------------------------------------------+
        | 🌱      | XDG_SESSION_TYPE=tty                                                                             |
        |         | HOME=/home/rootless                                                                              |
        |         | XDG_SESSION_CLASS=user                                                                           |
        |         | XDG_SESSION_ID=6                                                                                 |
        |         | XDG_RUNTIME_DIR=/run/user/1001                                                                   |
        |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
        |         | :/bin:/usr/games:/usr/local/games:/snap/bin                                                      |
        |         | DOCKER_CONFIG=/tmp/TestLoadStdinFromPipe1313022644/003                                           |
        |         | NERDCTL_TOML=/tmp/TestLoadStdinFromPipe1313022644/003/nerdctl.toml                               |
        +------------------------------------------------------------------------------------------------------------+
        || <1s (limit: 3m0s)                                                                                |
        +------------------------------------------------------------------------------------------------------------+
        | 📁      | /tmp/TestLoadStdinFromPipe1313022644/002                                                         |
        +------------------------------------------------------------------------------------------------------------+
        
    image_load_test.go:72: 	🔗 
        
        <<<<<<<<<<<<<<<<<<<<
        	🖊️ Inspecting output (contains)
        	👀 testing:		``
        	❌ FAILED!		~= `testloadstdinfrompipe-56915bd1`
        >>>>>>>>>>>>>>>>>>>>

Therefore, I'll see if the tests pass after the maintainer re-runs the CI.

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