-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Volume strategic merge #11062
Volume strategic merge #11062
Conversation
@openshift/cli-review @deads2k |
[test] |
Needs tests. |
@fabianofranz okay I am going to add some unit tests. Or did you mean some e2e tests too? |
please hold on from merging this until I add some more tests. |
@gnufied unit and if possible something in |
@fabianofranz PTAL, I have added unit tests for this. I do not think it is easily doable to further test this via |
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.
LGTM, however I am not expert on oc commands.
return fakeMapping | ||
} | ||
|
||
func TestVolumeRunWithPatch(t *testing.T) { |
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.
I would appreciate a test both for add and remove, this one does remove only.
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.
okay, will add. But partly It was intentional, the add path requires mocked objects which are rather complicated to fake/mock. :(
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.
Added a test for the scenario when volume is added as well.
@deads2k could you give this one a pass? |
if v.List { | ||
listingErrors := v.printVolumes(infos) | ||
if len(listingErrors) > 0 { | ||
return cmdutil.ErrExit |
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.
why aren't errors reported here?
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.
I could move error printing to here but since v.printVolumes
already prints the errors, I did not bother.
I didn't go super deep, but it looks reasonable. |
@jsafrane Added a test case for add volume scenario as well. PTAL. |
Could use a squash. |
Right, holding merge until it gets squashed. |
a7650c3
to
9e00dd4
Compare
@fabianofranz @deads2k Okay, I have squashed the commits. |
LGTM [merge] |
[test] |
The error here looks like a flake. |
This adds support for using PATCH method when adding or removing a volume from openshift asset (deployment configuration). Doing so will help prevent future race conditions and brings volume command on par with other similar command that use PATCH.
9e00dd4
to
f513896
Compare
Evaluated for origin test up to f513896 |
Flaked on #11094 |
Evaluated for origin merge up to f513896 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9671/) |
1 similar comment
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9671/) |
@fabianofranz @childsb while I am looking at #11094 do we want to block this PR from getting merged? |
@gnufied no, that's a flake unrelated to this PR. Working on it does not prevent this from getting merged. |
#11094 [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9770/) (Image: devenv-rhel7_5150) |
Implement volume request using strategic merge patch. Fixes #4351