Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 53 additions & 53 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions examples/nfs-volume.pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this pod file is useless?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was provided as an example of how to add an nfs volume to a pod.

"resource": {
"vcpu": 1,
"memory": 1024
},
"containers": [{
"image": "ubuntu",
"volumes": [{
"volume": "sharevolume",
"path": "/export",
"readOnly": false
}]
}],
"volumes": [{
"name": "sharevolume",
"source": "192.168.80.72:/export",
"format": "nas",
"fstype": "nfs"
}]
}
17 changes: 17 additions & 0 deletions hack/lib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ hyper::test::service() {
hyper::test::run_attached_pod ${HYPER_ROOT}/hack/pods/service.pod
}

hyper::test::nfs_volume() {
echo "create nfs volume server"
server=$(sudo hyperctl run -d hyperhq/nfs-server-tester | sed -ne "s/POD id is \(.*\)/\1/p")
ip=$(sudo hyperctl exec $server ip addr |sed -ne "s|.* \(.*\)/24.*|\1|p")
sleep 10 # nfs-server-tester takes a bit long to init in hykins
echo "create nfs volume client"
sed -e "s/NFSSERVER/$ip/" ${HYPER_ROOT}/hack/pods/nfs-client.pod > ${HYPER_TEMP}/nfs-client.pod
client=$(sudo hyperctl run -p ${HYPER_TEMP}/nfs-client.pod | sed -ne "s/POD id is \(.*\)/\1/p")
echo "check nfs file in nfs volume: /export/foo"
sleep 1 # sleep a bit to let client cmd to run
res=$(sudo hyperctl exec $server ls /export | grep foo > /dev/null 2>&1; echo $?)
echo "clean up nfs client/server"
sudo hyperctl rm $server $client
echo "check result should be 0, got: $res"
test $res -eq 0
}

hyper::test::command() {
id=$(sudo hyperctl run -t -d gcr.io/google_containers/etcd:2.0.9 /usr/local/bin/etcd | sed -ne "s/POD id is \(.*\)/\1/p")
sudo hyperctl rm $id
Expand Down
21 changes: 21 additions & 0 deletions hack/pods/nfs-client.pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"resource": {
"vcpu": 1,
"memory": 256
},
"containers": [{
"image": "busybox",
"command": ["/bin/sh", "-c", "touch /export/foo"],
"volumes": [{
"volume": "sharevolume",
"path": "/export",
"readOnly": false
}]
}],
"volumes": [{
"name": "sharevolume",
"source": "NFSSERVER:/export",
"format": "nas",
"fstype": "nfs"
}]
}
1 change: 1 addition & 0 deletions hack/test-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ __EOF__
hyper::test::map_file
hyper::test::with_volume
hyper::test::service
hyper::test::nfs_volume

stop_hyperd
}
Expand Down
1 change: 1 addition & 0 deletions types/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (pod *UserPod) Validate() error {
"vdi": true,
"vfs": true,
"rbd": true,
"nas": true,
}

hostnameLen := len(pod.Hostname)
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/hyperhq/runv/api/helpers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions vendor/github.com/hyperhq/runv/hypervisor/context.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions vendor/github.com/hyperhq/runv/hypervisor/disk.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/github.com/hyperhq/runv/hypervisor/hypervisor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/hyperhq/runv/hypervisor/qemu/qmp_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading