Bug 1466671
Summary: | oc patch always returns "patched" even if it doesn't do anything | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Eduardo Minguez <eminguez> |
Component: | oc | Assignee: | Fabiano Franz <ffranz> |
Status: | CLOSED ERRATA | QA Contact: | Xingxing Xia <xxia> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.5.0 | CC: | aos-bugs, ffranz, jokerman, mmccomas, myllynen, sdodson |
Target Milestone: | --- | ||
Target Release: | 3.7.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-11-28 21:59:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Eduardo Minguez
2017-06-30 08:20:00 UTC
1. Please check if patched field's name/level is correct. See https://bugzilla.redhat.com/show_bug.cgi?id=1409225#c3 2. > $ oc patch dc guestbook -p '{"spec":{"template":{"spec":{"imagePullPolicy":"Always"}}}}' > "guestbook" patched If user knows about how to use the merge key (said below), seems user will not be confused about this :) For "containers" field which is array, should use "a merge key" in oc patch. See `kubectl patch -h` which explains more detailed help info (e.g. about usage of merge key) than `oc patch -h`. (The oc help info issue is tracked in bug 1352453) (In reply to Xingxing Xia from comment #1) > 1. Please check if patched field's name/level is correct. > See https://bugzilla.redhat.com/show_bug.cgi?id=1409225#c3 > > 2. > > $ oc patch dc guestbook -p '{"spec":{"template":{"spec":{"imagePullPolicy":"Always"}}}}' > > "guestbook" patched > If user knows about how to use the merge key (said below), seems user will > not be confused about this :) > For "containers" field which is array, should use "a merge key" in oc patch. > See `kubectl patch -h` which explains more detailed help info (e.g. about > usage of merge key) than `oc patch -h`. (The oc help info issue is tracked > in bug 1352453) This was intentional. The problem is not the missing containers[] or whatever, the thing is if I create a non valid patch (as the one I've provided), it should say "patch not valid" or something similar, so, this works: $ oc patch dc guestbook -p '{"icantypewhatever":"yes"}' But it shouldn't. *** Bug 1466664 has been marked as a duplicate of this bug. *** Fixed in 3.6. Thank you Checked in v3.6.133, now it shows: $ oc patch dc database -p '{"spec":{"template":{"spec":{"imagePullPolicy":"Always"}}}}' deploymentconfig "database" not patched $ oc patch dc database -p '{"icantypewhatever":"yes"}' deploymentconfig "database" not patched This fixes original issue reported, so moving to VERIFIED (QE is checking many Modified bugs that if they're verifiable. Because fixed, moving to Verified. If have extra concern, pls correct me, thx) But it is better to have additional prompt such as "please check if the patch field's name/level is correct", this may help user self troubleshoot question such as: once ever a non-UI QE patches with singular "container" and wondered why not taking effect: '{"spec":{"template":{"spec":"container":... Then the guy asked me and I told should use plural "containers" WDYT? Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:3188 |