-
Notifications
You must be signed in to change notification settings - Fork 285
Do not use --force
with --dry-run
#633
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
base: master
Are you sure you want to change the base?
Conversation
5610c85
to
b22663c
Compare
|
b22663c
to
caa404a
Compare
d2060c0
to
8d14c43
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
==========================================
- Coverage 54.26% 53.52% -0.74%
==========================================
Files 64 64
Lines 6164 6520 +356
==========================================
+ Hits 3345 3490 +145
- Misses 2549 2753 +204
- Partials 270 277 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace behavior is controlled by the options submitted to the package https://github.com/kubernetes/kubectl/blob/4d27286e9c49486b259d0e722b10a11dccfeb494/pkg/cmd/replace/replace.go#L253C1-L253C2
GitOps engine code should respect these options. It would seem like force and dryRun options are not properly configured when calling the Replace command.
What should be done is to update the newReplaceOptions
to pass to the Run() method. We should set Force to false if DryRun is provided and we know that validate would throw an error. We should also call the validate method and return any error before calling the Run().
8d14c43
to
e4e8400
Compare
Signed-off-by: rafal-jan <rafal7jan@gmail.com>
e4e8400
to
c349708
Compare
|
Closes #623.
Currently the same value of force parameter is passed when performing dry-run of a resource and actually creating it on the cluster. This causes issues when using
Force=true
with sync waves.