Skip to content

Deprecation message when using 0.0.96 and older Toolbx container + tests - #1697

Merged
debarshiray merged 1 commit into
containers:mainfrom
DaliborKr:depr_flatpak_dbus_service
Sep 10, 2025
Merged

debarshiray merged 1 commit into
containers:mainfrom
DaliborKr:depr_flatpak_dbus_service

Conversation

@DaliborKr

Copy link
Copy Markdown
Collaborator

Added deprecation message when running a container that was created with Toolbx 0.0.96 and older, as described in #1684

@DaliborKr
DaliborKr requested a review from debarshiray as a code owner August 6, 2025 08:02

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this, @DaliborKr ! I didn't get a chance to try out the code changes and the test, so I only have some superficial comments.

Could you please add a link to the issue #1684 in the Git commit message, like we do in other commits? It makes it easier to follow the context of the commits in future. Otherwise, one has to open the commit in a web browser and then find the links.

There are some minor trailing whitespace and missing newline problems. The trailing whitespaces can cause confusion in future, because they can get deleted or added in future commits and cause false extra lines to show up in the diff. Git can help you detect them, if you use:

$ git config --global diff.wsErrorHighlight all

... or put this in your ~/.gitconfig:

[diff]
       wsErrorHighlight = all

Comment thread test/system/libs/helpers.bash Resolved
Comment thread test/system/104-run.bats Resolved
Comment thread test/system/104-run.bats Resolved
Comment thread test/system/104-run.bats Resolved
@DaliborKr
DaliborKr force-pushed the depr_flatpak_dbus_service branch from 494ab56 to 419bbba Compare August 6, 2025 13:46
@debarshiray
debarshiray force-pushed the depr_flatpak_dbus_service branch from 419bbba to 03ad7d2 Compare September 7, 2025 11:57

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this, @DaliborKr ! The changes mostly look good to me.

Comment thread test/system/104-run.bats Outdated
assert [ ${#stderr_lines[@]} -eq 2 ]
}

@test "run: Ensure that label 'com.github.containers.toolbox=true' is present in toolbx container" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some relatively minor points:

We should split this new test into a separate commit, because it's unrelated to the deprecation of old containers that use org.freedesktop.Flatpak.SessionHelper, as described in #1684

This is a test for the create command because it's checking if it added the com.github.containers.toolbox label to the container it created. So, it should go in test/system/101-create.bats.

The new thing that this test adds is the check for the label in the containers created by create. So, it can be merged with the existing tests for create by adding the podman inspect to them. We already use podman ps --all to check if the container was actually created, and this can be the next assertion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I took the liberty to address these in #1716 because they were relatively minor issues.

Comment thread test/system/104-run.bats Outdated

create_container "$container_name"

run podman inspect --format '{{ index .Config.Labels "com.github.containers.toolbox" }}' "$container_name"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cool! I didn't know that we can use index with a JSON dictionary. It would have made my life easier in the past. :)

Comment thread test/system/104-run.bats Outdated
run podman inspect --format '{{ index .Config.Labels "com.github.containers.toolbox" }}' "$container_name"

assert_success
assert_output --regexp "true"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't use the --regexp option here, because we aren't using any regular expressions, and there's no reason to expect anything other than true in the output. So, just:

  assert_output "true"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done in #1716

Comment thread test/system/libs/helpers.bash Outdated
function create_container_flatpak_dbus() (
local container_name

container_name="$1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: these two lines can be combined.

I know there are some places in the code base where the lines are split, but it is an anti-pattern caused by a misunderstanding. It's because ShellCheck complains about cases where command substitution is used.

Comment thread test/system/libs/helpers.bash Outdated
pull_default_image
distro="$(get_system_id)"
version="$(get_system_version)"
image_full="${IMAGES[$distro]}:$version"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's already a get_default_image function that does this. :)

Comment thread test/system/libs/helpers.bash Resolved
Comment thread test/system/libs/helpers.bash Outdated
return 1
fi

echo "$output" | grep -o "/.*/monitor"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Interesting. I didn't know about the -o option in grep(1). Looks very useful. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see that the output from the D-Bus method is:

({'path': <'/run/user/1000/.flatpak-helper/monitor'>, 'pkcs11-socket': <'/run/user/1000/.flatpak-helper/pkcs11-flatpak-39343'>},)

The problem is that if we parse the path by looking for "/.*/monitor", then we are assuming that the path will always end with /monitor. This defeats the purpose of querying the path from the D-Bus service, instead of assuming it and hard coding it.

Interestingly, the last time the path changed was in June 2018. Before that it used to be $XDG_RUNTIME_DIR/flatpak-monitor, and that value wouldn't fit "/.*/monitor".

I don't know what would be the best or easiest way to parse the path from our test suite. It's in the GVariant format and there are various ways to encode and decode it. The Go implementation of Toolbx uses github.com/godbus/dbus/v5 to parse it in CallFlatpakSessionHelper().

Until we figure out a correct way to parse it, let's just assume that it will be $XDG_RUNTIME_DIR/.flatpak-helper/monitor and hard code it. It used to be hard coded in the POSIX shell implementation and it hasn't changed in the last seven years. It's better to hard code, than have some extra code that misleadingly looks like it's doing it correctly, when it's not. :)

Comment thread src/cmd/run.go Outdated
}

fmt.Fprintf(os.Stderr, "Warning: container %s uses deprecated features\n", container.Name())
fmt.Fprintf(os.Stderr, "Consider recreating it with Toolbox version 0.0.97 or newer.\n")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also update the recommended version a few lines above from 0.0.17 to 0.0.97, because containers created with 0.0.17 to 0.0.96 are now deprecated.

@debarshiray
debarshiray force-pushed the depr_flatpak_dbus_service branch from 03ad7d2 to 7f5d314 Compare September 9, 2025 13:12
@debarshiray
debarshiray force-pushed the depr_flatpak_dbus_service branch from 7f5d314 to bc7085d Compare September 9, 2025 23:23
Comment thread test/system/libs/helpers.bash Outdated
)

# Print the full command
# printf "%q " "${podman_cmd[@]}" >> /tmp/toolbox_podman_command.log

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can use bats --trace ... for this. It will show all the commands that get executed.

@debarshiray
debarshiray force-pushed the depr_flatpak_dbus_service branch from bc7085d to 1b380a4 Compare September 10, 2025 00:23
Comment thread test/system/libs/helpers.bash Outdated
--dns none \
--env TOOLBOX_PATH="$TOOLBX" \
--name "$container_name" \
--network host \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be good to add the labels, because you have been working on checking the labels, and it will let us add another test to test/system/102-list.bats to ensure that these deprecated containers are listed.

Comment thread test/system/libs/helpers.bash Outdated
"$default_image" \
toolbox init-container \
--home "$HOME" \
--shell "$SHELL" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's add the --monitor-host option to init-container here.

We deprecated --monitor-host and stopped using it from Toolbx 0.0.99.5. It means that containers that were created by Toolbx < 0.0.97 to use org.freedesktop.Flatpak.SessionHelper still have the option, and init-container should continue to handle it. It is hard or rare to test deprecated code paths, so using it in this test is a good opportunity to test it.

Comment thread test/system/libs/helpers.bash Outdated
# Print the full command
# printf "%q " "${podman_cmd[@]}" >> /tmp/toolbox_podman_command.log

"${podman_cmd[@]}" || fail "Podman couldn't create container '$container_name'"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: we can use echo and return 1, like you had used when resolving the home directory and parsing the path used by org.freedesktop.Flatpak.SessionHelper.

I know fail is used in some other parts of the code base. However, over time, it seems to me that it doesn't have that many benefits over printing a message to the standard error stream and returning with a non zero value. The fail function isn't part of core Bats and comes from bats-support, which is sometimes not packaged by distributions, and we have to carry it as a Git submodule in Toolbx. If we stop using it, then we can drop this dependency.

Comment thread test/system/104-run.bats Outdated
assert [ ${#lines[@]} -eq 0 ]
lines=("${stderr_lines[@]}")
assert_line --index 0 "Warning: container $container uses deprecated features"
assert_line --index 1 "Consider recreating it with Toolbox version 0.0.97 or newer."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be Toolbx without the o. :)

Starting from Toolbx 0.0.97, released in November 2020, Toolbx
containers no longer need the org.freedesktop.Flatpak.SessionHelper
D-Bus interface.  This change was made to enable running toolbox(1) as
root [1].

It is going to be five years in a few months, since this change was
made, and it's becoming harder and harder to practically test backwards
compatibility with these containers.  All the host operating systems
where Toolbx is regularly tested offer newer versions:
  * Arch Linux and Fedora offer the latest upstream releases
  * RHEL 8.10 offers at least 0.0.99.4
  * Ubuntu offers at least 0.0.99.2 [2]

Therefore, this is a good time to mark these older containers as
deprecated, as has been done in the past in similar cases [3].  A
deprecation notice is the precursor to actually dropping support for
these old containers in the future.

[1] Commit 71b5c8c
    containers@71b5c8c0a235249b
    containers#591
    containers#267

[2] https://packages.ubuntu.com/jammy/podman-toolbox

[3] Commit 9dc5281
    containers@9dc52814301c5a3f
    containers#336

containers#1684
@debarshiray
debarshiray force-pushed the depr_flatpak_dbus_service branch from 1b380a4 to af1216b Compare September 10, 2025 13:56
@debarshiray
debarshiray merged commit af1216b into containers:main Sep 10, 2025
@debarshiray

debarshiray commented Sep 10, 2025 •

Copy link
Copy Markdown
Member

One thing that struck me while playing with this pull request, is that the deprecated container created by the test suite doesn't suffer from containers/crun#1841 even though we are not using podman create --mount type=devpts,destination=/dev/pts.

I tried to compile Toolbx 0.0.96 on Fedora 42 and the container it created did hit containers/crun#1841 and I failed to enter it. I wonder what is it about the deprecated container created by the test suite that it doesn't have this problem.

@debarshiray

Copy link
Copy Markdown
Member

Anyway, merged! Thanks for working on this.

debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Apr 9, 2026
A subsequent commit will switch to unmarshalling the JSON returned from
'podman inspect --format json --type image' directly inside
podman.InspectImage() to confine the details within the podman package
and make it easier to write unit tests for it.  eg., it requires
tracking changes to the JSON output across different Podman versions.

Unfortunately, the JSON from 'podman inspect --format json --type image'
and 'podman images --format json' are considerably different and it will
be awkward to use the same implementation of the json.Unmarshaler
interface [1] for both.  One option is to have two different concrete
types separately implement json.Unmarshaler to handle the differences in
the JSON, and then hiding these concrete types behind an Image interface
that provides access to the values parsed from the JSON.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [2].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [3], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [4].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [5].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [6].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [7].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] https://pkg.go.dev/encoding/json#Unmarshaler

[2] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[3] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[4] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[5] https://src.fedoraproject.org/container/fedora-toolbox

[6] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[7] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724
containers#1779
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Apr 9, 2026
A subsequent commit will switch to unmarshalling the JSON returned from
'podman inspect --format json --type image' directly inside
podman.InspectImage() to confine the details within the podman package
and make it easier to write unit tests for it.  eg., it requires
tracking changes to the JSON output across different Podman versions.

Unfortunately, the JSON from 'podman inspect --format json --type image'
and 'podman images --format json' are considerably different and it will
be awkward to use the same implementation of the json.Unmarshaler
interface [1] for both.  One option is to have two different concrete
types separately implement json.Unmarshaler to handle the differences in
the JSON, and then hiding these concrete types behind an Image interface
that provides access to the values parsed from the JSON.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [2].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [3], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [4].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [5].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [6].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [7].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] https://pkg.go.dev/encoding/json#Unmarshaler

[2] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[3] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[4] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[5] https://src.fedoraproject.org/container/fedora-toolbox

[6] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[7] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724
containers#1779
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Apr 10, 2026
A subsequent commit will switch to unmarshalling the JSON returned from
'podman inspect --format json --type image' directly inside
podman.InspectImage() to confine the details within the podman package
and make it easier to write unit tests for it.  eg., it requires
tracking changes to the JSON output across different Podman versions.

Unfortunately, the JSON from 'podman inspect --format json --type image'
and 'podman images --format json' are considerably different and it will
be awkward to use the same implementation of the json.Unmarshaler
interface [1] for both.  One option is to have two different concrete
types separately implement json.Unmarshaler to handle the differences in
the JSON, and then hiding these concrete types behind an Image interface
that provides access to the values parsed from the JSON.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [2].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [3], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [4].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [5].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [6].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [7].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] https://pkg.go.dev/encoding/json#Unmarshaler

[2] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[3] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[4] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[5] https://src.fedoraproject.org/container/fedora-toolbox

[6] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[7] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724
containers#1779
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Apr 10, 2026
A subsequent commit will switch to unmarshalling the JSON returned from
'podman inspect --format json --type image' directly inside
podman.InspectImage() to confine the details within the podman package
and make it easier to write unit tests for it.  eg., it requires
tracking changes to the JSON output across different Podman versions.

Unfortunately, the JSON from 'podman inspect --format json --type image'
and 'podman images --format json' are considerably different and it will
be awkward to use the same implementation of the json.Unmarshaler
interface [1] for both.  One option is to have two different concrete
types separately implement json.Unmarshaler to handle the differences in
the JSON, and then hiding these concrete types behind an Image interface
that provides access to the values parsed from the JSON.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [2].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [3], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [4].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [5].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [6].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [7].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] https://pkg.go.dev/encoding/json#Unmarshaler

[2] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[3] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[4] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[5] https://src.fedoraproject.org/container/fedora-toolbox

[6] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[7] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724
containers#1779
debarshiray pushed a commit to debarshiray/toolbox that referenced this pull request Apr 11, 2026
A subsequent commit will switch to unmarshalling the JSON returned from
'podman inspect --format json --type image' directly inside
podman.InspectImage() to confine the details within the podman package
and make it easier to write unit tests for it.  eg., it requires
tracking changes to the JSON output across different Podman versions.

Unfortunately, the JSON from 'podman inspect --format json --type image'
and 'podman images --format json' are considerably different and it will
be awkward to use the same implementation of the json.Unmarshaler
interface [1] for both.  One option is to have two different concrete
types separately implement json.Unmarshaler to handle the differences in
the JSON, and then hiding these concrete types behind an Image interface
that provides access to the values parsed from the JSON.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [2].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [3], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [4].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [5].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [6].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [7].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] https://pkg.go.dev/encoding/json#Unmarshaler

[2] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[3] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[4] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[5] https://src.fedoraproject.org/container/fedora-toolbox

[6] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[7] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724
containers#1779
debarshiray pushed a commit to DaliborKr/toolbox that referenced this pull request Apr 11, 2026
Unmarshal the JSON from 'podman inspect --format json --type image'
directly inside podman.InspectImage() to confine the details within the
podman package.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [1].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [2], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [3].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

[1] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[2] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[3] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

containers#1724

Signed-off-by: Dalibor Kricka <[email protected]>
debarshiray pushed a commit to DaliborKr/toolbox that referenced this pull request May 11, 2026
Unmarshal the JSON from 'podman inspect --format json --type image'
directly inside podman.InspectImage() to confine the details within the
podman package.

The JSON samples for the unit tests were taken using the default Toolbx
image on versions of Fedora that shipped a specific Podman and Toolbx
version.  This accounts for differences in the JSON caused by different
major versions of Podman and the way different Toolbx images were built.

One exception was Fedora 28, which had Podman 1.1.2 and Toolbx 0.0.9,
which was the last Toolbx version before 'toolbox init-container' became
the entry point for all Toolbx containers [1].  However, the default
Toolbx image is no longer available from registry.fedoraproject.org.
Hence, the image for Fedora 29 was used.

The minimum required Podman version is 1.6.4 [2], and the Go
implementation has been encouraging users to create containers with
Toolbx version 0.0.97 or newer [3].  The versions used to collect the
JSON samples for the unit tests were chosen accordingly.  They don't
exhaustively cover all possible supported and unsupported version
combinations, but hopefully enough to be useful.

The fedora-toolbox image went through a series of significant changes
during the Fedora 39 and 40 development cycles.  Fedora 38 was the last
release where the image was built from a Container/Dockerfile [4].  For
Fedora 39, it was rewritten in terms of fedora-kickstarts and
pungi-fedora for the ToolbxReleaseBlocker Change [5].  For Fedora 40, it
was rewritten as a KIWI description as part of the KiwiBuiltCloudImages
Change [6].  Hence, all three Fedora versions were chosen to cover this
transition.

[1] Commit 8b84b5e
    containers@8b84b5e4604921fa
    containers#160

[2] Commit 8e80dd5
    containers@8e80dd5db1e6f40b
    containers#1253

[3] Commit af1216b
    containers@af1216b2720c7ab5
    containers#1697
    containers#1684

[4] https://src.fedoraproject.org/container/fedora-toolbox

[5] https://fedoraproject.org/wiki/Changes/ToolbxReleaseBlocker

[6] https://fedoraproject.org/wiki/Changes/KiwiBuiltCloudImages

containers#1724

Signed-off-by: Dalibor Kricka <[email protected]>
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.

2 participants