Skip to content
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

Add support for dry-run #74

Merged
merged 3 commits into from
Aug 25, 2024
Merged

Conversation

michaeldmitry
Copy link
Contributor

@michaeldmitry michaeldmitry commented Aug 21, 2024

Fixes #73

Solution

Add a dry_run optional argument to patch, replace, create, delete, delete_collection for AsyncClient and Client that will pass a dryRun query parameter to requests.
Additionally, fixed some linting :)

Context

Dry-running a request would be a nice addition (and a lightweight one too!) for users to perform validation calls to their spec changes that are not strictly typed by lightkube (e.g: resources limits and requests are dicts and are prone to invalid values like {"CpU": "-100km"})

@ca-scribner
Copy link
Collaborator

ca-scribner commented Aug 23, 2024

hey @gtsystem how do you feel about this? afaict it addresses all the points raised in #42, which was abandoned. I haven't manually tested it but at least the concept makes sense. wdyt?

@gtsystem
Copy link
Owner

No concern regarding the new feature. However it's hard to review as the styling changes add a lot of noise. @michaeldmitry can you isolate styling changes and actual feature in separate commits?

Also it would be good to know what tool are you using for styling and if there is any special configuration

@michaeldmitry
Copy link
Contributor Author

@gtsystem separated (as much as possible) formatting and feature changes into 2 commits.
black version 24.8.0 is used for formatting with no special config.

BTW, should I bump the version in setup.py?

@gtsystem
Copy link
Owner

gtsystem commented Aug 24, 2024

@gtsystem separated (as much as possible) formatting and feature changes into 2 commits. black version 24.8.0 is used for formatting with no special config.

Looks good.

BTW, should I bump the version in setup.py?

Yes, please

@michaeldmitry
Copy link
Contributor Author

@gtsystem separated (as much as possible) formatting and feature changes into 2 commits. black version 24.8.0 is used for formatting with no special config.

Looks good.

BTW, should I bump the version in setup.py?

Yes, please

Done :)

@gtsystem gtsystem merged commit 75c7142 into gtsystem:master Aug 25, 2024
9 checks passed
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.

Add support for dryRun
3 participants