Skip to content

NO-JIRA: fix(pydantic_schemas): new podman version changed output of podman info #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jiridanek
Copy link
Member

@jiridanek jiridanek commented May 4, 2025

Schema needs to be updated to also handle a list[str] value that may now be present.

Description

❯ podman version
Client:        Podman Engine
Version:       5.4.2
API Version:   5.4.2
Go Version:    go1.24.2
Built:         Wed Apr  2 15:43:09 2025
Build Origin:  brew
OS/Arch:       darwin/arm64

Server:       Podman Engine
Version:      5.4.1
API Version:  5.4.1
Go Version:   go1.23.7
Git Commit:   b79bc8afe796cba51dd906270a7e1056ccdfcf9e
Built:        Tue Mar 11 01:00:00 2025
OS/Arch:      linux/arm64

How Has This Been Tested?

Pytest tests work on my machine now whereas before they would fail with pydantic validation error.

INTERNALERROR>     info = tests.containers.pydantic_schemas.PodmanInfo.model_validate(podman_client.info())
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/Users/jdanek/IdeaProjects/notebooks/.venv/lib/python3.12/site-packages/pydantic/main.py", line 627, in model_validate
INTERNALERROR>     return cls.__pydantic_validator__.validate_python(
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> pydantic_core._pydantic_core.ValidationError: 1 validation error for PodmanInfo
INTERNALERROR> store.graphOptions.`overlay.additionalImageStores`
INTERNALERROR>   Input should be a valid string [type=string_type, input_value=['/usr/lib/containers/storage'], input_type=list]
INTERNALERROR>     For further information visit https://errors.pydantic.dev/2.10/v/string_type

Process finished with exit code 3

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot added the size/s label May 4, 2025
@openshift-ci openshift-ci bot requested review from atheo89 and daniellutz May 4, 2025 20:26
@openshift-ci openshift-ci bot added size/s and removed size/s labels May 4, 2025
@jstourac
Copy link
Member

jstourac commented May 5, 2025

Thanks for this Jiri; is this backward compatible or shall we be sure all team-members are on some decent version of podman?

@jiridanek
Copy link
Member Author

It strictly expands the set of jsons that will be parsed without error, so yes, backwards compatible.

@jiridanek
Copy link
Member Author

@jiridanek
Copy link
Member Author

Yeah, class Config is so Pydantic v1, I'll update to the v2 syntax.

@jiridanek jiridanek force-pushed the jd_podman_info_schema branch from 18eafa7 to 54e2ebd Compare May 5, 2025 09:33
@openshift-ci openshift-ci bot added size/m and removed size/s labels May 5, 2025
…`podman info`

Schema needs to be updated to also handle a `list[str]` value that may now be present.
@jiridanek jiridanek force-pushed the jd_podman_info_schema branch from 54e2ebd to 3c3e788 Compare May 5, 2025 09:34
@openshift-ci openshift-ci bot added size/xs and removed size/m labels May 5, 2025
@jstourac
Copy link
Member

jstourac commented May 5, 2025

/lgtm

@jiridanek
Copy link
Member Author

/approve

/override ci/prow/images
not applicable

Copy link
Contributor

openshift-ci bot commented May 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiridanek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label May 5, 2025
Copy link
Contributor

openshift-ci bot commented May 5, 2025

@jiridanek: Overrode contexts on behalf of jiridanek: ci/prow/images

In response to this:

/approve

/override ci/prow/images
not applicable

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 6cd9ddb into opendatahub-io:main May 5, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants