Skip to content

Volume strategic merge - #11062

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
gnufied:volume-strategic-merge
Oct 8, 2016
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
gnufied:volume-strategic-merge

Conversation

@gnufied

@gnufied gnufied commented Sep 23, 2016

Copy link
Copy Markdown
Member

Implement volume request using strategic merge patch. Fixes #4351

@fabianofranz

Copy link
Copy Markdown
Contributor

@openshift/cli-review @deads2k

@fabianofranz

Copy link
Copy Markdown
Contributor

@liggitt

@fabianofranz

Copy link
Copy Markdown
Contributor

[test]

@fabianofranz

Copy link
Copy Markdown
Contributor

Needs tests.

@fabianofranz

Copy link
Copy Markdown
Contributor

@smarterclayton

@gnufied

gnufied commented Sep 27, 2016

Copy link
Copy Markdown
Member Author

@fabianofranz okay I am going to add some unit tests. Or did you mean some e2e tests too?

@gnufied

gnufied commented Sep 27, 2016

Copy link
Copy Markdown
Member Author

please hold on from merging this until I add some more tests.

@fabianofranz

Copy link
Copy Markdown
Contributor

@gnufied unit and if possible something in test/cmd/volumes.sh. Thanks!

@gnufied

gnufied commented Sep 28, 2016

Copy link
Copy Markdown
Member Author

@fabianofranz PTAL, I have added unit tests for this. I do not think it is easily doable to further test this via test/cmd/volume.sh externally since nothing changes from end user perspective. cc @childsb

@jsafrane jsafrane left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread pkg/cmd/cli/cmd/set/volume_test.go Outdated
return fakeMapping
}

func TestVolumeRunWithPatch(t *testing.T) {

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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. :(

Copy link
Copy Markdown
Member Author

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.

@fabianofranz

Copy link
Copy Markdown
Contributor

@deads2k could you give this one a pass?

if v.List {
listingErrors := v.printVolumes(infos)
if len(listingErrors) > 0 {
return cmdutil.ErrExit

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Member Author

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.

@deads2k

deads2k commented Oct 3, 2016

Copy link
Copy Markdown
Contributor

I didn't go super deep, but it looks reasonable.

@gnufied

gnufied commented Oct 4, 2016

Copy link
Copy Markdown
Member Author

@jsafrane Added a test case for add volume scenario as well. PTAL.

@deads2k

deads2k commented Oct 4, 2016

Copy link
Copy Markdown
Contributor

Could use a squash.

@fabianofranz

Copy link
Copy Markdown
Contributor

Could use a squash.

Right, holding merge until it gets squashed.

@gnufied
gnufied force-pushed the volume-strategic-merge branch 2 times, most recently from a7650c3 to 9e00dd4 Compare October 4, 2016 17:57
@gnufied

gnufied commented Oct 4, 2016

Copy link
Copy Markdown
Member Author

@fabianofranz @deads2k Okay, I have squashed the commits.

@fabianofranz

Copy link
Copy Markdown
Contributor

LGTM [merge]

@gnufied

gnufied commented Oct 5, 2016

Copy link
Copy Markdown
Member Author

[test]

@gnufied

gnufied commented Oct 5, 2016

Copy link
Copy Markdown
Member Author

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.
@gnufied
gnufied force-pushed the volume-strategic-merge branch from 9e00dd4 to f513896 Compare October 5, 2016 16:15
@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to f513896

@fabianofranz

Copy link
Copy Markdown
Contributor

Flaked on #11094
re[merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to f513896

@openshift-bot

Copy link
Copy Markdown
Contributor

1 similar comment
@openshift-bot

Copy link
Copy Markdown
Contributor

@gnufied

gnufied commented Oct 6, 2016

Copy link
Copy Markdown
Member Author

@fabianofranz @childsb while I am looking at #11094 do we want to block this PR from getting merged?

@fabianofranz

Copy link
Copy Markdown
Contributor

@gnufied no, that's a flake unrelated to this PR. Working on it does not prevent this from getting merged.

@gnufied

gnufied commented Oct 7, 2016

Copy link
Copy Markdown
Member Author

#11094 [merge]

@openshift-bot

openshift-bot commented Oct 8, 2016 •

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9770/) (Image: devenv-rhel7_5150)

@openshift-bot
openshift-bot merged commit 997ff87 into openshift:master Oct 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants