New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure PD Plugin (Blob + Managed Disks) #41950

Closed
wants to merge 38 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+7 −6
Diff settings

Always

Just for now

Viewing a subset of changes. View all

fix for caching mode defaulting to none

  • Loading branch information...
khenidak committed Feb 15, 2017
commit 37d7af652bd9de51c3d9187c4f0a448ff8013d4f
@@ -172,12 +172,12 @@ func normalizeStorageAccountType(storageAccountType string) (string, error) {
return storageAccountType, nil
}
func normalizeCachingMode(cachingMode string) (string, error) {
func normalizeCachingMode(cachingMode v1.AzureDataDiskCachingMode) (v1.AzureDataDiskCachingMode, error) {
if cachingMode == "" {
return default_caching_mode, nil
return v1.AzureDataDiskCachingMode(default_caching_mode), nil
}
if !supportedCachingModes.Has(cachingMode) {
if !supportedCachingModes.Has(string(cachingMode)) {
return "", fmt.Errorf("azureDisk - %s is not supported cachingmode. Supported values are %s", cachingMode, supportedCachingModes.List())
}
return cachingMode, nil
@@ -79,7 +79,8 @@ func (p *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
}
}
var storageAccountType, fsType, cachingMode string
var storageAccountType, fsType string

This comment has been minimized.

@rootfs

rootfs Mar 6, 2017

Member

use var () block

@rootfs

rootfs Mar 6, 2017

Member

use var () block

var cachingMode v1.AzureDataDiskCachingMode
var kind v1.AzureDataDiskKind
var err error
@@ -102,7 +103,7 @@ func (p *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
case "kind":
kind = v1.AzureDataDiskKind(strings.ToLower(v))
case "cachingmode":
cachingMode = strings.ToLower(v)
cachingMode = v1.AzureDataDiskCachingMode(strings.ToLower(v))
case "fstype":
fsType = strings.ToLower(v)
default:
@@ -158,7 +159,7 @@ func (p *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
},
PersistentVolumeSource: v1.PersistentVolumeSource{
AzureDisk: &v1.AzureDiskVolumeSource{
CachingMode: cachingMode,
CachingMode: &cachingMode,
DiskName: name,
DataDiskURI: diskUri,
Kind: &kind,
ProTip! Use n and p to navigate between commits in a pull request.