Commit 3087a10b authored by Ian Chakeres's avatar Ian Chakeres

Updated local-volume boostrapper/provisioner e2e test for new config format

The local-volume bootstrapper/provisioner configuration format changed in https://github.com/kubernetes-incubator/external-storage/pull/352 This format is exposed in v2.0.0 of the provisioner and boostratpper images. This PR updates the e2e test config, so that the existing tests continue to work.
parent 8f4f07fc
...@@ -40,6 +40,7 @@ go_library( ...@@ -40,6 +40,7 @@ go_library(
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
"//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library",
"//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library",
"//vendor/github.com/ghodss/yaml:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/google.golang.org/api/googleapi:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library",
......
...@@ -17,7 +17,6 @@ limitations under the License. ...@@ -17,7 +17,6 @@ limitations under the License.
package storage package storage
import ( import (
"encoding/json"
"fmt" "fmt"
"math/rand" "math/rand"
"path" "path"
...@@ -26,6 +25,7 @@ import ( ...@@ -26,6 +25,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/ghodss/yaml"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
...@@ -118,8 +118,8 @@ const ( ...@@ -118,8 +118,8 @@ const (
// volumeConfigName is the configmap passed to bootstrapper and provisioner // volumeConfigName is the configmap passed to bootstrapper and provisioner
volumeConfigName = "local-volume-config" volumeConfigName = "local-volume-config"
// bootstrapper and provisioner images used for e2e tests // bootstrapper and provisioner images used for e2e tests
bootstrapperImageName = "quay.io/external_storage/local-volume-provisioner-bootstrap:v1.0.1" bootstrapperImageName = "quay.io/external_storage/local-volume-provisioner-bootstrap:v2.0.0"
provisionerImageName = "quay.io/external_storage/local-volume-provisioner:v1.0.1" provisionerImageName = "quay.io/external_storage/local-volume-provisioner:v2.0.0"
// provisioner daemonSetName name, must match the one defined in bootstrapper // provisioner daemonSetName name, must match the one defined in bootstrapper
daemonSetName = "local-volume-provisioner" daemonSetName = "local-volume-provisioner"
// provisioner node/pv cluster role binding, must match the one defined in bootstrapper // provisioner node/pv cluster role binding, must match the one defined in bootstrapper
...@@ -959,12 +959,24 @@ func deleteClusterRoleBinding(config *localTestConfig) { ...@@ -959,12 +959,24 @@ func deleteClusterRoleBinding(config *localTestConfig) {
} }
func createVolumeConfigMap(config *localTestConfig) { func createVolumeConfigMap(config *localTestConfig) {
mountConfig := struct { // MountConfig and ProvisionerConfiguration from
HostDir string `json:"hostDir"` // https://github.com/kubernetes-incubator/external-storage/blob/master/local-volume/provisioner/pkg/common/common.go
}{ type MountConfig struct {
HostDir: path.Join(hostBase, discoveryDir), // The hostpath directory
HostDir string `json:"hostDir" yaml:"hostDir"`
} }
data, err := json.Marshal(&mountConfig) type ProvisionerConfiguration struct {
// StorageClassConfig defines configuration of Provisioner's storage classes
StorageClassConfig map[string]MountConfig `json:"storageClassMap" yaml:"storageClassMap"`
}
var provisionerConfig ProvisionerConfiguration
provisionerConfig.StorageClassConfig = map[string]MountConfig{
config.scName: {
HostDir: path.Join(hostBase, discoveryDir),
},
}
data, err := yaml.Marshal(&provisionerConfig.StorageClassConfig)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
configMap := v1.ConfigMap{ configMap := v1.ConfigMap{
...@@ -977,7 +989,7 @@ func createVolumeConfigMap(config *localTestConfig) { ...@@ -977,7 +989,7 @@ func createVolumeConfigMap(config *localTestConfig) {
Namespace: config.ns, Namespace: config.ns,
}, },
Data: map[string]string{ Data: map[string]string{
config.scName: string(data), "storageClassMap": string(data),
}, },
} }
_, err = config.client.CoreV1().ConfigMaps(config.ns).Create(&configMap) _, err = config.client.CoreV1().ConfigMaps(config.ns).Create(&configMap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment