Skip to content

Commit

Permalink
Merge pull request #20456 from juanvallejo/jvallejo/update-patch-retu…
Browse files Browse the repository at this point in the history
…rn-code-logic

UPSTREAM: 66725: update exit code to 0 if patch not needed
  • Loading branch information
openshift-merge-robot authored Aug 1, 2018
2 parents 0dc3307 + 11814da commit c83ba6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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.

0 comments on commit c83ba6c

Please sign in to comment.