Skip to content

Commit

Permalink
Merge pull request sodafoundation#190 from opensds/development
Browse files Browse the repository at this point in the history
Merge from Development to Master to prepare for Capri Milestone-1
  • Loading branch information
xing-yang authored Feb 7, 2019
2 parents 911bb4c + 837fadd commit a5c264a
Show file tree
Hide file tree
Showing 331 changed files with 1,899 additions and 36,577 deletions.
238 changes: 124 additions & 114 deletions Gopkg.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

[[constraint]]
name = "github.com/opensds/opensds"
version = "0.4.0"
version = "0.5.0"

[[constraint]]
name = "github.com/pmorie/go-open-service-broker-client"
Expand Down Expand Up @@ -78,5 +78,6 @@
version = "kubernetes-1.13.0-beta.1"

[prune]
non-go = true
go-tests = true
unused-packages = true
12 changes: 11 additions & 1 deletion client/opensds/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ import (
)

const (

// OpenSDSEndPoint environment variable name
OpenSDSEndPoint = "OPENSDS_ENDPOINT"

// OpenSDSAuthStrategy environment variable name
OpenSDSAuthStrategy = "OPENSDS_AUTH_STRATEGY"
)

var (
opensdsClient *client.Client
)

// GetClient return OpenSDS Client
func GetClient(endpoint string, authStrategy string) *client.Client {
if opensdsClient != nil {
return opensdsClient
}

if endpoint == "" {
// Get endpoint from environment
endpoint = os.Getenv(OpenSDSEndPoint)
Expand Down Expand Up @@ -53,5 +62,6 @@ func GetClient(endpoint string, authStrategy string) *client.Client {
cfg.AuthOptions = client.NewNoauthOptions(constants.DefaultTenantId)
}

return client.NewClient(cfg)
opensdsClient = client.NewClient(cfg)
return opensdsClient
}
15 changes: 13 additions & 2 deletions csi/server/deploy/kubernetes/csi-attacher-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ spec:
serviceAccount: csi-attacher
containers:
- name: csi-attacher
# TODO: replace with official image when available
image: xyang105/test-attacher:k8s1.13.0_beta.2 #quay.io/k8scsi/csi-attacher:v1.0.0
image: quay.io/k8scsi/csi-attacher:v1.0.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand All @@ -47,6 +46,18 @@ spec:
mountPath: /csi
- name: iscsi-dir
mountPath: /etc/iscsi/
- name: cluster-driver-registrar
image: quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1
args:
- "--v=5"
- "--pod-info-mount-version=\"v1\""
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: opensds
image: opensdsio/csiplugin:latest
args :
Expand Down
6 changes: 6 additions & 0 deletions csi/server/deploy/kubernetes/csi-attacher-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ rules:
- apiGroups: ["csi.storage.k8s.io"]
resources: ["csinodeinfos"]
verbs: ["get", "list", "watch"]
- apiGroups: ["csi.storage.k8s.io"]
resources: ["csidrivers"]
verbs: ["create", "delete", "get", "list", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create","get", "list", "watch","delete"]

---
kind: ClusterRoleBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ spec:
serviceAccount: csi-nodeplugin
hostNetwork: true
containers:
- name: driver-registrar
# TODO: replace the following with official image when available
image: xyang105/test-registrar:release1.0 #quay.io/k8scsi/driver-registrar:v1.0-canary #v1.0.0
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.1
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
- "--mode=node-register"
- "--driver-requires-attachment=true"
- "--pod-info-mount-version=v1"
- "--kubelet-registration-path=$(ADDRESS)"
env:
- name: ADDRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-provisioner
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.0.0
image: quay.io/k8scsi/csi-provisioner:v1.0.1
args:
- "--provisioner=csi-opensdsplugin"
- "--csi-address=$(ADDRESS)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-snapshotter
containers:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.0.0
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
args:
- "--snapshotter=csi-opensdsplugin"
- "--csi-address=$(ADDRESS)"
Expand Down
4 changes: 1 addition & 3 deletions service-broker/cmd/service-broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ func runWithContext(ctx context.Context) error {
addr := ":" + strconv.Itoa(options.Port)

dbStore := store.NewStore(options.StoreType, options.StoreEndpoint)

c := sdsController.NewController(options.Endpoint, options.AuthOption)
c.LoadStoreHandler(dbStore)
c := sdsController.NewController(options.Endpoint, options.AuthOption, dbStore)

// Prom. metrics
reg := prom.NewRegistry()
Expand Down
9 changes: 1 addition & 8 deletions service-broker/config/config_osdsbroker.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lifecycle": [
{
"operation": "provision",
"plan_id": "d3031751-XXXX-XXXX-XXXX-a42377d3320e",
"plan_id": "0f4008b5-XXXX-XXXX-XXXX-dace631cd648",
"async": true,
"parameters": {
"name": "vol-01",
Expand Down Expand Up @@ -56,12 +56,5 @@
"description": "This is a volume provided by opensds",
"capacity": 1
}
},
"conflictiveBind": {
"service_id" :"4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468",
"plan_id": "d3031751-XXXX-XXXX-XXXX-a42377d3320e",
"parameters": {
"nodeId": "host02"
}
}
}
20 changes: 20 additions & 0 deletions service-broker/config/config_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

source ./vars.sh

sed -i 's/^plan_id: .*/plan_id: '"$plan_id"'/g' ./config_osdsbroker.json
sed -i 's/^nodeId: .*/nodeId: '"$nodeId"'/g' ./config_osdsbroker.json
21 changes: 21 additions & 0 deletions service-broker/config/vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Normally this field specifies the default profile id
plan_id=d3031751-XXXX-XXXX-XXXX-a42377d3320e

# Please modify nodeId to your real hostname
nodeId=host
Loading

0 comments on commit a5c264a

Please sign in to comment.