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: 69215: Fix flake in CSI plugin e2e test #20967

Merged

Conversation

bertinatto
Copy link
Member

@bertinatto bertinatto commented Sep 13, 2018

This PR fixes a flake in the CSI plugin test.

During the test, the container hostpath-driver exposes the socket /csi/csi.sock so that other containers can connect to and perform CSI operations.

Since hostpath-driver container is privileged, other containers can't access the socket because they don't have the proper permission for it. As a result, the other containers need to be privileged as well.

The flake only happens in OKD, so I haven't submitted a PR to upstream.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1622670

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 13, 2018
@bertinatto
Copy link
Member Author

/sig storage

@bertinatto
Copy link
Member Author

/assign @wongma7

@bertinatto
Copy link
Member Author

CC @tsmetana

@wongma7
Copy link
Contributor

wongma7 commented Sep 13, 2018

/lgtm
I think it is harmless to carry this patch for now but I wonder too why it is needed here but not upstream. What is the openshift equivalent of /var/lib/kubelet? Maybe it has something to do with the setgid bit on /var/lib/kubelet?

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 13, 2018
@bertinatto
Copy link
Member Author

I think the problem lies in the fact that Openshift maps hostPath volumes to external XFS partitions instead of mapping it to the host's filesystem. This is the output of the command mount executed inside the container:

/ # mount | grep csi
/dev/mapper/rhel-root on /csi type xfs (rw,seclabel,relatime,attr2,inode64,noquota)

I believe in this case the files stored in the mount point are subject to different security policies than they would be if they were stored in the host (i.e., as it happens in Kubernetes).

[1] https://github.com/bertinatto/kubernetes/blob/516876b232c8fa45689f0754a5865aad1aaa2f7b/test/e2e/storage/csi_objects.go#L330

@bertinatto
Copy link
Member Author

/assign @gnufied

@gnufied
Copy link
Member

gnufied commented Sep 27, 2018

Just to confirm - we are sure that external-provisioner pod isn't already privileged right? I think what may be happening is - on upstream in absence of selinux the other pods are able to access that socket but in case of selinux since we don't peform relabeling of hostpaths, other pods can't access socket unless privileged. It seems like an oversight in my opinion to have driver pod privileged and other pods not. Lets submit this to upstream and see what people think?

@bertinatto
Copy link
Member Author

Just to confirm - we are sure that external-provisioner pod isn't already privileged right?

Yes, I inspected the container during the test and it wasn't privileged.

Also, here is a test run with commit 5e39b only; it fails with the message described in the Bugzilla ticket above:

https://openshift-gce-devel.appspot.com/build/origin-ci-test/pr-logs/pull/21121/pull-ci-openshift-origin-master-e2e-gcp/107#sig-storage-csi-volumes-csi-plugin-test-using-csi-driver-hostpath-should-provision-storage-suiteopenshiftconformanceparallel-suitek8s

Lets submit this to upstream and see what people think?

Sure, I can try submitting the patch upstream.

@bertinatto
Copy link
Member Author

Submitted upstream: kubernetes/kubernetes#69215

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 30, 2018
@bertinatto bertinatto changed the title Fix CSI plugin test UPSTREAM: 69215: Fix flake in CSI plugin e2e test Sep 30, 2018
@bertinatto
Copy link
Member Author

The upstream PR [1] was merged, so I updated this one to carry that patch instead.

[1] kubernetes/kubernetes#69215

@bertinatto
Copy link
Member Author

/test cmd

@gnufied
Copy link
Member

gnufied commented Oct 1, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2018
@gnufied
Copy link
Member

gnufied commented Oct 1, 2018

/assign @knobunc @smarterclayton for final merge.

@bertinatto thanks for fixing this!

@knobunc
Copy link
Contributor

knobunc commented Oct 2, 2018

/lgtm
/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bertinatto, gnufied, knobunc, wongma7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2018
@knobunc
Copy link
Contributor

knobunc commented Oct 2, 2018

/assign @smarterclayton

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 2b4abdc into openshift:master Oct 3, 2018
@openshift-ci-robot
Copy link

@bertinatto: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_builds e9302aa link /test extended_builds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. sig/storage size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants