-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remap
image_pull_policy
field on Container
from ImagePullPolicy
…
… enum to `str` (#877) **Pull Request Checklist** - [x] Fixes #784 - [x] Tests added - [x] Documentation/examples added - [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** When an autogenerated object is created through the service the service returns auto generated objects. This means the services relies on autogenerated code _only_. #784 documents how creating an autogen `Workflow` object fails because the value of `Always` does not fit the `Template.container.imagePullPolicy` field. This happens because the returned value is of type `str` (from the Argo Server) while the Python value is an enum of type `ImagePullPolicy`. This is caused by an inconsistency in the OpenAPI specification. Some fields use `str` for image pull policy (look at Events, User Container, etc) while Container uses `ImagePullPolicy`. This PR changes the field in the OpenAPI schema specification so that this Container field is also a `str`. This should solve #784. Our Pydantic configuration is set to use enum values, which means that users who rely on the autogen Container object and pass the ImagePullPolicy object in will have Pydantic automatically extract the `.value` field of that enum. The Hera objects already accommodate both str and ImagePullPolicy, so no breaking change there. --------- Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
- Loading branch information
1 parent
c2ef94b
commit c8980bd
Showing
5 changed files
with
60 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters