Skip to content

Commit b80467d

Browse files
committed
minor fixes
1 parent 70c5d15 commit b80467d

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ deploy:
3232
skip_cleanup: true
3333
on:
3434
repo: travisghansen/freenas-iscsi-provisioner
35-
branch: "master"
35+
all_branches: true
36+
condition: $TRAVIS_BRANCH =~ ^master|next$
3637

3738
- provider: script
3839
script: bash .travis/docker-release.sh

.travis/docker-release.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
55
if [[ -n "${TRAVIS_TAG}" ]];then
66
docker build --pull -t travisghansen/freenas-iscsi-provisioner:${TRAVIS_TAG} .
77
docker push travisghansen/freenas-iscsi-provisioner:${TRAVIS_TAG}
8-
elif [[ "${TRAVIS_BRANCH}" == "master" ]];then
9-
docker build --pull -t travisghansen/freenas-iscsi-provisioner:latest .
10-
docker push travisghansen/freenas-iscsi-provisioner:latest
8+
elif [[ -n "${TRAVIS_BRANCH}" ]];then
9+
if [[ "${TRAVIS_BRANCH}" == "master" ]];then
10+
docker build --pull -t travisghansen/freenas-iscsi-provisioner:latest .
11+
docker push travisghansen/freenas-iscsi-provisioner:latest
12+
else
13+
docker build --pull -t travisghansen/freenas-iscsi-provisioner:${TRAVIS_BRANCH} .
14+
docker push travisghansen/freenas-iscsi-provisioner:${TRAVIS_BRANCH}
15+
fi
1116
else
1217
:
1318
fi

deploy/class.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ parameters:
2929
# the name of the parent dataset (or simply pool) where all resources will
3030
# be created, it *must* exist before provisioner will work
3131
# Note: due to length limitations with iscsi the total string length must
32-
# NOT exceed 22 chars (this includes slashes etc)
32+
# NOT exceed 17 chars (this includes slashes etc)
3333
# example: tank/k8s/mycluster
3434
# default: tank
3535
#datasetParentName:

freenas/iscsi_config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package freenas
22

33
import (
44
"errors"
5+
"fmt"
6+
"io/ioutil"
57
"net/http"
68

79
"github.com/golang/glog"
@@ -42,6 +44,11 @@ func (i *ISCSIConfig) Get(server *Server) (*http.Response, error) {
4244
return resp, err
4345
}
4446

47+
if resp.StatusCode != 200 {
48+
body, _ := ioutil.ReadAll(resp.Body)
49+
return resp, fmt.Errorf("Error getting iscsi_config - message: %v, status: %d", body, resp.StatusCode)
50+
}
51+
4552
i.CopyFrom(&iscsiConfig)
4653

4754
return resp, nil

0 commit comments

Comments
 (0)