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

UPSTREAM: 66725: update exit code to 0 if patch not needed #20456

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/cmd/basicresources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ os::cmd::expect_success "echo '${group_json}' | oc create -f -"
os::cmd::expect_success "oc patch group patch-group -p 'users: [\"myuser\"]' --loglevel=8"
os::cmd::expect_success_and_text 'oc get group patch-group -o yaml' 'myuser'
os::cmd::expect_success "oc patch group patch-group -p 'users: []' --loglevel=8"
# applying the same patch twice results in exit code 0, and "not patched" text
os::cmd::expect_success_and_text "oc patch group patch-group -p 'users: []'" "not patched"
# applying an invalid patch results in exit code 1 and an error
os::cmd::expect_failure_and_text "oc patch group patch-group -p 'users: \"\"'" "cannot restore slice from string"
os::cmd::expect_success_and_text 'oc get group patch-group -o yaml' 'users: \[\]'
echo "patch: ok"
os::test::junit::declare_suite_end
Expand Down
9 changes: 1 addition & 8 deletions vendor/k8s.io/kubernetes/pkg/kubectl/cmd/patch.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.