Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from openebs/openebs-provisioner-dev
Browse files Browse the repository at this point in the history
Merge changes from openebs-provisioner-dev to release for 0.5.0-RC1
  • Loading branch information
kmova authored Nov 27, 2017
2 parents b40c002 + 913fdb6 commit 93a05fb
Show file tree
Hide file tree
Showing 2,574 changed files with 378,070 additions and 349,768 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ flycheck_*.el

# snapshot binaries
/snapshot/_output
/snapshot/deploy/docker/controller/snapshot-controller
/snapshot/deploy/docker/provisioner/snapshot-provisioner
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
all: aws/efs ceph/cephfs ceph/rbd flex gluster/block gluster/glusterfs iscsi/targetd local-volume/provisioner local-volume/bootstrapper nfs-client nfs snapshot openstack/standalone-cinder
.PHONY: all

clean: clean-aws/efs clean-ceph/cephfs clean-ceph/rbd clean-flex clean-gluster/block clean-gluster/glusterfs clean-iscsi/targetd clean-local-volume/provisioner clean-local-volume/bootstrapper clean-nfs-client clean-nfs clean-snapshot clean-openstack/standalone-cinder
clean: clean-aws/efs clean-ceph/cephfs clean-ceph/rbd clean-flex clean-gluster/block clean-gluster/glusterfs clean-iscsi/targetd clean-local-volume/provisioner clean-local-volume/bootstrapper clean-nfs-client clean-nfs clean-openebs clean-snapshot clean-openstack/standalone-cinder
.PHONY: clean

test: test-aws/efs test-local-volume/provisioner test-nfs

test: test-aws/efs test-local-volume/provisioner test-nfs test-snapshot test-openstack/standalone-cinder
.PHONY: test

verify:
Expand Down Expand Up @@ -176,11 +177,21 @@ openstack/standalone-cinder:
make
.PHONY: openstack/standalone-cinder

test-openstack/standalone-cinder:
cd openstack/standalone-cinder; \
make test
.PHONY: test-openstack/standalone-cinder

clean-openstack/standalone-cinder:
cd openstack/standalone-cinder; \
make clean
.PHONY: clean-openstack/standalone-cinder

test-snapshot:
cd snapshot; \
make test
.PHONY: test-snapshot

push-cephfs-provisioner:
cd ceph/cephfs; \
make push
Expand Down
2 changes: 1 addition & 1 deletion OWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
assignees:
approvers:
- wongma7
- jsafrane
2 changes: 1 addition & 1 deletion aws/efs/OWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assignees:
approvers:
- wongma7
6 changes: 4 additions & 2 deletions ceph/cephfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ FROM centos:7
ENV CEPH_VERSION "jewel"
RUN rpm -Uvh https://download.ceph.com/rpm-$CEPH_VERSION/el7/noarch/ceph-release-1-1.el7.noarch.rpm && \
yum install -y epel-release && \
yum install -y ceph-common python-cephfs
yum install -y ceph-common python-cephfs && \
yum clean all

COPY cephfs-provisioner /usr/local/bin/cephfs-provisioner
COPY cephfs_provisioner/cephfs_provisioner.py /usr/local/bin/cephfs_provisioner
CMD ["chmod", "o+x", "/usr/local/bin/cephfs_provisioner"]
RUN chmod -v o+x /usr/local/bin/cephfs_provisioner

2 changes: 1 addition & 1 deletion ceph/cephfs/OWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assignees:
approvers:
- rootfs
5 changes: 3 additions & 2 deletions ceph/cephfs/cephfs-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per
v1.ResourceName(v1.ResourceStorage): options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)],
},
PersistentVolumeSource: v1.PersistentVolumeSource{
CephFS: &v1.CephFSVolumeSource{
CephFS: &v1.CephFSPersistentVolumeSource{
Monitors: mon,
Path: res.Path[strings.Index(res.Path, "/"):],
SecretRef: &v1.LocalObjectReference{
SecretRef: &v1.SecretReference{
Name: secretName,
// TODO https://github.com/kubernetes-incubator/external-storage/issues/309
},
User: user,
},
Expand Down
2 changes: 1 addition & 1 deletion ceph/rbd/OWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
assignees:
approvers:
- rootfs
- cofyc
42 changes: 0 additions & 42 deletions ceph/rbd/pkg/provision/helper.go

This file was deleted.

3 changes: 2 additions & 1 deletion ceph/rbd/pkg/provision/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/golang/glog"
"github.com/kubernetes-incubator/external-storage/lib/controller"
"github.com/kubernetes-incubator/external-storage/lib/util"
"github.com/pborman/uuid"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -90,7 +91,7 @@ func (p *rbdProvisioner) getAccessModes() []v1.PersistentVolumeAccessMode {

// Provision creates a storage asset and returns a PV object representing it.
func (p *rbdProvisioner) Provision(options controller.VolumeOptions) (*v1.PersistentVolume, error) {
if !AccessModesContainedInAll(p.getAccessModes(), options.PVC.Spec.AccessModes) {
if !util.AccessModesContainedInAll(p.getAccessModes(), options.PVC.Spec.AccessModes) {
return nil, fmt.Errorf("invalid AccessModes %v: only AccessModes %v are supported", options.PVC.Spec.AccessModes, p.getAccessModes())
}
if options.PVC.Spec.Selector != nil {
Expand Down
34 changes: 24 additions & 10 deletions ceph/rbd/pkg/provision/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,40 @@ func (u *RBDUtil) rbdStatus(image string, pOpts *rbdProvisionOptions) (bool, err
for i := start; i < start+l; i++ {
mon := pOpts.monitors[i%l]
// cmd "rbd status" list the rbd client watch with the following output:
//
// # there is a watcher (exit=0)
// Watchers:
// watcher=10.16.153.105:0/710245699 client.14163 cookie=1
//
// # there is no watcher (exit=0)
// Watchers: none
//
// Otherwise, exit is non-zero, for example:
//
// # image does not exist (exit=2)
// rbd: error opening image kubernetes-dynamic-pvc-<UUID>: (2) No such file or directory
//
glog.V(4).Infof("rbd: status %s using mon %s, pool %s id %s key %s", image, mon, pOpts.pool, pOpts.adminID, pOpts.adminSecret)
args := []string{"status", image, "--pool", pOpts.pool, "-m", mon, "--id", pOpts.adminID, "--key=" + pOpts.adminSecret}
cmd, err = u.execCommand("rbd", args)
output = string(cmd)

if err != nil {
// ignore error code, just checkout output for watcher string
// TODO: Why should we ignore error code here? Igorning error code here cause we only try first monitor.
glog.Warningf("failed to execute rbd status on mon %s", mon)
// break if command succeeds
if err == nil {
break
}
}

if strings.Contains(output, imageWatcherStr) {
glog.V(4).Infof("rbd: watchers on %s: %s", image, output)
return true, nil
}
glog.Warningf("rbd: no watchers on %s", image)
return false, nil
// If command never succeed, returns its last error.
if err != nil {
return false, err
}

if strings.Contains(output, imageWatcherStr) {
glog.V(4).Infof("rbd: watchers on %s: %s", image, output)
return true, nil
}
glog.Warningf("rbd: no watchers on %s", image)
return false, nil
}

Expand Down
11 changes: 10 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ local-volume-provisioner-bootstrap
local-volume-provisioner
nfs-client-provisioner
nfs-provisioner
openebs-provisioner
rbd-provisioner
)

Expand All @@ -43,7 +44,15 @@ if [[ "${TRAVIS_TAG}" =~ $regex ]]; then
export REGISTRY=quay.io/kubernetes_incubator/
fi
echo "Pushing image '${PROVISIONER}' with tags '${VERSION}' and 'latest' to '${REGISTRY}'."
make push-"${PROVISIONER}"
if [[ "${PROVISIONER}" = openebs-provisioner ]]; then
export DIMAGE="${REGISTRY}openebs-provisioner"
export DNAME="${QUAY_USERNAME}"
export DPASS="${QUAY_PASSWORD}"
pushd openebs; make; popd
make deploy-openebs-provisioner
else
make push-"${PROVISIONER}"
fi
else
echo "Nothing to deploy"
fi
Expand Down
2 changes: 1 addition & 1 deletion flex/OWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assignees:
approvers:
- childsb
Loading

0 comments on commit 93a05fb

Please sign in to comment.