Commit Graph

1448 Commits

Author SHA1 Message Date
Debarshi Ray c2096cb7fa build: Bump github.com/spf13/viper to 1.18.2
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1630
2025-04-28 13:56:45 +02:00
Debarshi Ray 4dac44d42e build: Bump github.com/spf13/viper to 1.18.1
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1630
2025-04-28 13:55:13 +02:00
Debarshi Ray 454c05685a build: Bump github.com/spf13/viper to 1.18.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1630
2025-04-28 13:44:22 +02:00
Debarshi Ray 9989ffac14 cmd/root, pkg/utils: Use errors.Is() instead of os.IsNotExist()
The os.IsNotExist() function [1] predates the introduction of the
errors.Is() function [2] in Go 1.13 [3].  From Go >= 1.16, the
documentation explicitly recommends the use of errors.Is() instead of
os.IsNotExist() [4].

The Go implementation of Toolbx never used any Go older than 1.13 [5],
and currently it requires Go >= 1.21 [6].  So, there's no reason not to
use the more modern and recommended alternative.

[1] https://pkg.go.dev/os#IsNotExist

[2] https://pkg.go.dev/errors#Is

[3] https://go.dev/blog/go1.13-errors

[4] Go commit b641f0dcf48aa748
    https://github.com/golang/go/commit/b641f0dcf48aa748
    https://github.com/golang/go/issues/41122

[5] Commit d857471aa2
    https://github.com/containers/toolbox/commit/d857471aa2f233e5
    https://github.com/containers/toolbox/pull/318

[6] Commit 82e85bac9f
    https://github.com/containers/toolbox/commit/82e85bac9f5e69a5
    https://github.com/containers/toolbox/pull/1614

https://github.com/containers/toolbox/pull/1629
2025-04-28 13:39:49 +02:00
Debarshi Ray e9e77fb069 pkg/utils: Test PathExists
https://github.com/containers/toolbox/pull/1629
2025-04-28 13:29:28 +02:00
Debarshi Ray c4df57944e cmd/run: Style fixes
Fallout from d8289fb832 and
815d7f6035

https://github.com/containers/toolbox/pull/1628
2025-04-26 00:10:31 +02:00
Debarshi Ray 389216cdca cmd/initContainer: Tweak the debug logs for brevity
Debug logs are sweeter when they are shorter.

Fallout from 6e848b250b and
91a019bef6

https://github.com/containers/toolbox/pull/1628
2025-04-25 23:48:53 +02:00
Debarshi Ray fd427863b0 cmd/initContainer: Style fixes
Fallout from the following:
  * 7542f5fc86
  * 786723116c
  * 6e848b250b

https://github.com/containers/toolbox/pull/1628
2025-04-25 23:48:48 +02:00
Debarshi Ray 94a75d631b build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.4
... for CVE-2025-23359 or GHSA-4hmh-pm5p-9j7j.

The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1627
2025-04-23 03:06:16 +02:00
Debarshi Ray e824bf7216 build: Bump github.com/NVIDIA/go-nvlib to 0.7.1
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1626
2025-04-23 00:02:03 +02:00
Debarshi Ray ec286bb186 pkg/utils: Optimize getting the runtime directory
The runtime directory is needed a few times during the course of
commonly used Toolbx commands.  It's used at start-up for all commands
except 'completion' and 'init-container' to synchronize the invocation
of 'podman system migrate'.  The entry point (ie., 'init-container')
uses it to read the generated Container Device Interface specification
and create the initialization stamp file.  The 'enter' and 'run'
commands use it to write the CDI specification and twice to detect the
creation of the initialization stamp file.

Since the runtime directory is always the same within a process, there's
no need to repeatedly go through all the steps of parsing the user and
group IDs, creating the directory, setting its ownership, and logging
the name of directory.  Once the directory is successfully created, it's
path can be cached and returned for subsequent use.

In case an error occurred while setting up the runtime directory,
subsequent attempts to get it will go through all the steps again.  This
doesn't matter much in practice because toolbox(1) can't continue in the
absence of a working runtime directory.

https://github.com/containers/toolbox/pull/1624
2025-04-11 22:10:53 +02:00
Debarshi Ray 3321bb20b6 cmd/root: Style fix
Fallout from 4a1aa4652e and
c2ba67569b

https://github.com/containers/toolbox/pull/1623
2025-04-11 17:12:06 +02:00
Debarshi Ray fb4cb2eb90 cmd/run: Style fixes
Fallout from d8289fb832 and
815d7f6035

https://github.com/containers/toolbox/pull/1623
2025-04-11 17:11:35 +02:00
Debarshi Ray c2520f2016 .zuul: Enable testing on Fedora 42
https://github.com/containers/toolbox/pull/1619
2025-03-29 01:03:01 +01:00
Debarshi Ray 4f4c3c9d19 build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.3
... for CVE-2024-0135 or GHSA-9v84-cc9j-pxr6, CVE-2024-0136 or
GHSA-vcfp-63cx-4h59, and CVE-2024-0137 or GHSA-frhw-w3wm-6cw4.

The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1614
2025-01-31 00:24:26 +01:00
Debarshi Ray ebd2fc1f8b build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.2
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1614
2025-01-30 23:01:26 +01:00
Debarshi Ray 8b603ad05f build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.1
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1614
2025-01-30 21:36:14 +01:00
Debarshi Ray 82e85bac9f build: Bump github.com/NVIDIA/nvidia-container-toolkit to 1.17.0
... for CVE-2024-0134 or GHSA-7jm9-xpwx-v999.

NVIDIA Container Toolkit 1.17.0 requires Go >= 1.21, even though it's
not mentioned in its go.mod file [1].

The src/go.sum file was updated with 'go mod tidy'.

[1] https://github.com/NVIDIA/nvidia-container-toolkit/issues/886

https://github.com/containers/toolbox/pull/1614
2025-01-30 21:36:14 +01:00
Debarshi Ray 4717be5e23 build: Bump github.com/NVIDIA/go-nvlib to 0.7.0
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1614
2025-01-30 00:28:24 +01:00
Debarshi Ray 957601f1d8 build: Bump github.com/NVIDIA/go-nvml to 0.12.4-1
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1614
2025-01-29 21:20:28 +01:00
Debarshi Ray 85fcd6f4c7 build: Bump golang.org/x/sys to 0.26.0
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1613
2025-01-29 21:09:10 +01:00
Debarshi Ray 09773b9af2 build: Bump golang.org/x/sys to 0.25.0
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1613
2025-01-29 21:03:54 +01:00
Debarshi Ray bff269a9e9 build: Bump github.com/spf13/viper to 1.17.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-27 18:46:01 +01:00
Debarshi Ray 5196d21294 build: Bump github.com/spf13/viper to 1.16.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-27 17:58:27 +01:00
Debarshi Ray 03fd9c5498 build: Bump github.com/spf13/viper to 1.15.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

The src/go.sum file was skipped from the codespell test because it's
generated with 'go mod tidy'.  Otherwise codespell would complain:
  : github.com/spf13/viper v1.15.0
      h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
  > github.com/spf13/viper v1.15.0/go.mod
      h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
  : github.com/stretchr/objx v0.1.0/go.mod
      h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
  ./src/go.sum:384: KeT ==> key, kept

https://github.com/containers/toolbox/pull/1612
2025-01-27 14:51:32 +01:00
Debarshi Ray 8829db69c5 build: Bump github.com/spf13/viper to 1.14.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-24 19:57:48 +01:00
Debarshi Ray 9c19e2d8f0 build: Bump github.com/spf13/viper to 1.13.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-24 17:35:47 +01:00
Debarshi Ray 6400ff245d build: Bump github.com/spf13/viper to 1.12.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-24 01:37:29 +01:00
Debarshi Ray 10e1544938 build: Bump github.com/spf13/viper to 1.11.0
The indirect dependencies in the src/go.mod file, and the src/go.sum
file were updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1612
2025-01-23 17:44:43 +01:00
Debarshi Ray 97ad50d303 build: Bump github.com/briandowns/spinner to 1.23.2
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1611
2025-01-23 17:39:42 +01:00
Debarshi Ray 8b62d7e95d .github/workflows, playbooks: Unbreak 'go mod download'
Currently, the CI is failing because 'go mod download' is encountering an
expired TLS certificate:
  $ go mod download
  go: github.com/spf13/viper@v1.10.1 requires
      go.opencensus.io@v0.23.0: unrecognized import path "go.opencensus.io":
        https fetch: Get "https://go.opencensus.io/?go-get=1": tls: failed to
        verify certificate: x509: certificate has expired or is not yet valid:
        current time 2025-01-23T17:00:16+01:00 is after 2025-01-21T03:43:04Z

Therefore, disable the TLS certificate check until the certificate gets
updated or the dependency gets removed [1].

[1] https://pkg.go.dev/cmd/go#hdr-Environment_variables

https://github.com/containers/toolbox/pull/1611
2025-01-23 17:39:42 +01:00
Debarshi Ray 4b61032711 build: Bump github.com/stretchr/testify to 1.10.0
The src/go.sum file was updated with 'go mod tidy'.

https://github.com/containers/toolbox/pull/1610
2025-01-20 21:27:35 +01:00
Debarshi Ray 0bb4ff8b80 .zuul: Drop testing on Fedora 39
Fedora 39 reached End of Life on 26th November 2024:
https://docs.fedoraproject.org/en-US/releases/eol/

https://github.com/containers/toolbox/pull/1602
2024-12-09 18:47:05 +01:00
Debarshi Ray b378596b14 test/system: Try to handle /etc/resolv.conf on host as absolute symlink
Some Arch Linux hosts have /etc/resolv.conf as an absolute symbolic link
to /run/systemd/resolve/stub-resolv.conf, instead of being a relative
symbolic link to ../run/systemd/resolve/stub-resolv.conf or a regular
file.  eg., the images built by arch-boxes [1].

This changes the target that the Toolbx container's /etc/resolv.conf
points at and confuses the tests [2].

Ideally, these host operating systems should be fixed to use relative
symbolic links.  This is highlighted by skipping the tests, because
there's no point in failing them until that happens.

This is a step towards running the CI on Arch Linux.

[1] https://gitlab.archlinux.org/archlinux/arch-boxes
    https://geo.mirror.pkgbuild.com/images/latest/

[2] Commit 88a95b07af
    https://github.com/containers/toolbox/commit/88a95b07af335be2
    https://github.com/containers/toolbox/issues/187

https://github.com/containers/toolbox/issues/1438
2024-11-18 20:45:44 +01:00
Debarshi Ray f900585739 test/system: Enable 102-list.bats on Arch Linux
This is a step towards running the CI on Arch Linux.

https://github.com/containers/toolbox/issues/1438
2024-11-17 11:26:29 +01:00
Penn Bauman fead837404 test/system: Enable 101-create.bats on Arch Linux
This is a step towards running the CI on Arch Linux.

https://github.com/containers/toolbox/issues/1438
https://github.com/containers/toolbox/pull/1535
2024-11-17 11:26:29 +01:00
Penn Bauman e805291a10 test/system: Support host operating systems without VERSION_ID
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will run the CI on Arch Linux.  Hence, the code to
get the default release from the host operating system can no longer
assume the presence of the VERSION_ID field in os-release(5).

Note that the arch-toolbox image is tagged with 'latest', in accordance
with OCI conventions, not 'rolling' [2,3], which is the os-release(5)
BUILD_ID.

A similar change was made to toolbox(1) in commits 2ee82affeb and
d14fd7bb50.

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

[2] Commit 2568528cb7
    https://github.com/containers/toolbox/commit/2568528cb7f52663
    https://github.com/containers/toolbox/pull/861

[3] Commit a4e5861ae5
    https://github.com/containers/toolbox/commit/a4e5861ae5c93625
    https://github.com/containers/toolbox/pull/1308

https://github.com/containers/toolbox/issues/1438
https://github.com/containers/toolbox/pull/1535
2024-11-17 11:26:29 +01:00
Debarshi Ray d8ad631ae1 test/system: Check the line count in the standard error & output streams
https://github.com/containers/toolbox/pull/1596
2024-11-15 21:53:56 +01:00
Debarshi Ray 02648e61ea test/system: Fix typo
This wasn't negatively impacting the validity of the test, but it was
inconsistent with the pattern used elsewhere.

Fallout from 55c0e63786

https://github.com/containers/toolbox/pull/1596
2024-11-15 19:45:40 +01:00
Debarshi Ray d29adbf10e test/system: Ensure that error messages go to the standard error stream
Currently, there's no way to get assert_line to use the stderr_lines
array [1].  This is worked around by assigning stderr_lines to the
'lines' array.

[1] https://github.com/bats-core/bats-assert/issues/42

https://github.com/containers/toolbox/pull/1595
2024-11-15 18:54:38 +01:00
Debarshi Ray f97d524af4 test/system: Check whole lines instead of partials
https://github.com/containers/toolbox/pull/1595
2024-11-14 22:57:26 +01:00
Debarshi Ray adc8650660 test/system: Optimize the 'create' tests
The system tests can be very I/O intensive, because many of them copy
OCI images from the test suite's image cache directory to its local
container/storage store, create containers, and then delete everything
to run the next test with a clean slate.  This makes them slow.

In the case of these two particular tests, toolbox(1) is supposed to
validate the command line options before trying to find the image.  So,
there's no need to copy the image from the test suite's image cache
directory to its local container/storage store.

If the toolbox(1) code breaks, then either it won't throw the expected
error or it will download the image before validating the command line
options.  The first possibility will be easily detected.  The other
could have been harder to notice, but, fortunately, commit
55c0e63786 added variants of these tests without the --assumeyes
option and there are other tests to ensure that images cannot be
downloaded without that option.  So, any unexpected attempts to download
the image will be caught by those variants of these tests.

Fallout from 32b147b9ff

https://github.com/containers/toolbox/pull/1595
2024-11-14 22:55:42 +01:00
Debarshi Ray 91c539606a test/system: Remove unnecessary --assumeyes
It shouldn't be necessary to use the --assumeyes option when creating a
Toolbx container, if the corresponding image is already present in the
local containers/storage image store.  It's harmful to test it with the
option, even when it shouldn't be needed, because it's off by default
and most users won't enable it.

Therefore, it's better to test the most common scenario that most users
will encounter.

https://github.com/containers/toolbox/pull/1595
2024-11-14 12:43:26 +01:00
Debarshi Ray fbffd45384 playbooks, test/system: Drop the PODMAN and SKOPEO environment variables
The toolbox(1) binary always relies on the PATH environment variable to
find the podman(1) and skopeo(1) binaries.  There's no way to override
those with the PODMAN and SKOPEO environment variables, and they only
affect any direct use of podman(1) and skopeo(1) within the test suite.

Therefore, offering the PODMAN and SKOPEO environment variables in their
current form is needlessly confusing and misleading, and can lead to
surprises arising from different podman(1) and skopeo(1) binaries being
used in different places.  Either toolbox(1) should also honour them or
the test suite shouldn't offer them.  The former is more complicated
without any obvious need for it, so the latter was chosen.

https://github.com/containers/toolbox/pull/1592
2024-11-14 02:06:33 +01:00
Debarshi Ray c11a03ce37 playbooks: Use pkgconfig(bash-completion) to install bash-completion.pc
Unlike Fedora, where the package providing bash-completion.pc changed in
Fedora 41 onwards [1,2], it hasn't changed in CentOS Stream 9.  So, this
doesn't change the behaviour of the CI.

However, the Fedora Packaging Guidelines recommend using pkgconfig(...)
to depend on a *.pc file [3], instead of the name of the package, and
there has been a problem on Fedora caused by not doing that.  Therefore,
it's better to follow the guidelines for consistency and safety.

[1] Fedora bash-completion commit d1f5dc48c0440cc6
    https://src.fedoraproject.org/rpms/bash-completion/c/d1f5dc48c0440cc6
    https://bugzilla.redhat.com/show_bug.cgi?id=1457164

[2] Commit 204919917e
    https://github.com/containers/toolbox/commit/204919917e4af528

[3] https://docs.fedoraproject.org/en-US/packaging-guidelines/PkgConfigBuildRequires/

https://github.com/containers/toolbox/pull/1593
2024-11-14 01:20:00 +01:00
Debarshi Ray 204919917e playbooks: Restore the generation & installation of the Bash completions
The package providing /usr/share/pkgconfig/bash-completion.pc changed
from bash-completion to bash-completion-devel in Fedora 41 onwards [1].
This meant that the Bash completions were no longer being generated and
installed by the CI.

[1] Fedora bash-completion commit d1f5dc48c0440cc6
    https://src.fedoraproject.org/rpms/bash-completion/c/d1f5dc48c0440cc6
    https://bugzilla.redhat.com/show_bug.cgi?id=1457164

https://github.com/containers/toolbox/pull/1593
2024-11-12 23:09:38 +01:00
Debarshi Ray 05202bb35c test/system: Skip the test before doing any needless work
https://github.com/containers/toolbox/pull/1591
2024-11-12 01:35:36 +01:00
Debarshi Ray 9b1f7aa573 .github/workflows, test/system: Enable 102-list.bats on Ubuntu 22.04
https://github.com/containers/toolbox/pull/1591
2024-11-12 01:35:36 +01:00
Debarshi Ray b443428126 playbooks/dependencies-centos-9-stream: Show the Bash version
Fallout from 6626b11e15

https://github.com/containers/toolbox/pull/1587
2024-11-06 01:01:50 +01:00
Debarshi Ray bb2cda1db0 cmd/create: Replace deprecated github.com/briandowns/spinner API
A new API was added to github.com/briandowns/spinner 1.23.0 to deprecate
the io.Writer output in favour of a pointer to an os.File [1].  This new
API enables the spinner to automatically detect whether the output is
connected to a terminal or not, which is convenient.

Commit 944b3ac95f already bumped the required
github.com/briandowns/spinner version to 1.23.0, so take advantage of
that.

[1] github.com/briandowns/spinner commit 1445186377e2e283
    https://github.com/briandowns/spinner/commit/1445186377e2e283
    https://github.com/briandowns/spinner/issues/142

https://github.com/containers/toolbox/pull/1586
2024-11-01 23:48:04 +01:00