Skip to content

Commit

Permalink
chore: update cloud-provider-azure
Browse files Browse the repository at this point in the history
  • Loading branch information
nearora-msft committed Apr 29, 2021
1 parent 6d44804 commit 5ba65bd
Show file tree
Hide file tree
Showing 873 changed files with 133,631 additions and 16,043 deletions.
10 changes: 5 additions & 5 deletions go.mod
Expand Up @@ -3,7 +3,7 @@ module sigs.k8s.io/azurefile-csi-driver
go 1.16

require (
github.com/Azure/azure-sdk-for-go v51.2.0+incompatible
github.com/Azure/azure-sdk-for-go v53.1.0+incompatible
github.com/Azure/azure-storage-file-go v0.8.0
github.com/Azure/go-autorest/autorest v0.11.17
github.com/Azure/go-autorest/autorest/adal v0.9.10
Expand All @@ -20,14 +20,14 @@ require (
github.com/pelletier/go-toml v1.7.0
github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021
github.com/stretchr/testify v1.6.1
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
google.golang.org/grpc v1.28.0
k8s.io/api v0.20.0
k8s.io/apimachinery v0.20.0
k8s.io/apimachinery v0.22.0-alpha.0.0.20210417144234-8daf28983e6e
k8s.io/client-go v0.20.0
k8s.io/cloud-provider v0.20.0
k8s.io/component-base v0.20.0
k8s.io/klog/v2 v2.4.0
k8s.io/klog/v2 v2.8.0
k8s.io/kubernetes v1.21.0-alpha.0.0.20201210005053-f58c4d8cd725
k8s.io/mount-utils v0.0.0
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
Expand Down Expand Up @@ -68,7 +68,7 @@ replace (
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.20.0
k8s.io/sample-controller => k8s.io/sample-controller v0.20.0
sigs.k8s.io/azurefile-csi-driver => ./
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.1-0.20210309160100-909ddd2c9371
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.1-0.20210428063649-9c3d7ab4b44f
)

replace github.com/niemeyer/pretty => github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
57 changes: 53 additions & 4 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/azurefile/azure.go
Expand Up @@ -23,7 +23,7 @@ import (
"runtime"
"strings"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"

"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/azurefile/controllerserver.go
Expand Up @@ -209,7 +209,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
resourceGroup = d.cloud.ResourceGroup
}

tags, err := azure.ConvertTagsToMap(customTags)
tags, err := convertTagsToMap(customTags)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/azurefile/controllerserver_test.go
Expand Up @@ -26,7 +26,7 @@ import (
"strings"
"testing"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
"sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-12-01/compute"
Expand Down
27 changes: 27 additions & 0 deletions pkg/azurefile/utils.go
Expand Up @@ -17,13 +17,19 @@ limitations under the License.
package azurefile

import (
"fmt"
"strings"
"sync"
"time"

"k8s.io/klog/v2"
)

const (
tagsDelimiter = ","
tagKeyValueDelimiter = "="
)

// lockMap used to lock on entries
type lockMap struct {
sync.Mutex
Expand Down Expand Up @@ -128,3 +134,24 @@ func createStorageAccountSecret(account, key string) map[string]string {
secret[defaultSecretAccountKey] = key
return secret
}

func convertTagsToMap(tags string) (map[string]string, error) {
m := make(map[string]string)
if tags == "" {
return m, nil
}
s := strings.Split(tags, tagsDelimiter)
for _, tag := range s {
kv := strings.Split(tag, tagKeyValueDelimiter)
if len(kv) != 2 {
return nil, fmt.Errorf("Tags '%s' are invalid, the format should like: 'key1=value1,key2=value2'", tags)
}
key := strings.TrimSpace(kv[0])
if key == "" {
return nil, fmt.Errorf("Tags '%s' are invalid, the format should like: 'key1=value1,key2=value2'", tags)
}
value := strings.TrimSpace(kv[1])
m[key] = value
}
return m, nil
}
202 changes: 0 additions & 202 deletions vendor/github.com/Azure/azure-sdk-for-go/LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5ba65bd

Please sign in to comment.