Skip to content

Commit

Permalink
VolumeLables for unmanaged clusters (#44)
Browse files Browse the repository at this point in the history
* VolumeLables for unmanaged clusters

* VolumeLables for unmanaged clusters

* VolumeLables for unmanaged clusters

* VolumeLables for unmanaged clusters

* VolumeLables for unmanaged clusters
  • Loading branch information
sameshai authored Jun 21, 2022
1 parent 5fabac8 commit 2c07e65
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/IBM/ibm-csi-common
go 1.16

require (
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta4
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta5
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta5
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta6
github.com/container-storage-interface/spec v1.3.0
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
github.com/gofrs/uuid v4.2.0+incompatible
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7 h1:eHgfQl6IeSmzWUyiSi13CvoFYsovoyq
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
github.com/IBM/go-sdk-core/v5 v5.9.1 h1:06pXbD9Rgmqqe2HA5YAeQbB4eYRRFgIoOT+Kh3cp1zo=
github.com/IBM/go-sdk-core/v5 v5.9.1/go.mod h1:axE2JrRq79gIJTjKPBwV6gWHswvVptBjbcvvCPIxARM=
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta4 h1:h5vUOeIitxpLTV/iD6F8OvuxHvvHoMDaZu3VXcUMfjw=
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta4/go.mod h1:v1aT8G3Tib8pCwdr9VweNFYa94GejBuqIVTysoaVI0g=
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta5 h1:FJk99J6Bk5WFI/EOmlVtxX2JXJMURlkezPJLjvS6+A0=
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta5/go.mod h1:nB0Pk0f7Prvl99DtQRUfpkQdAzFXv34Dd1lkCQrlJyQ=
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta5 h1:XPNIrp4g7oEx7QOy6eB98jZs7n1tB6DTsUjEigOhouM=
github.com/IBM/ibmcloud-volume-interface v1.0.1-beta5/go.mod h1:v1aT8G3Tib8pCwdr9VweNFYa94GejBuqIVTysoaVI0g=
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta6 h1:D5wkqGoGfIqqH3fJwUwDj5zfQVzQqSnA7qNPiR4sYog=
github.com/IBM/ibmcloud-volume-vpc v1.0.1-beta6/go.mod h1:CFBvpt4SKwf0mQg3u53qkZ5SxZH9gZSfdhWBa8GIP3Y=
github.com/IBM/secret-common-lib v1.0.3 h1:rhhAtAE1ANSuxhA8Nulzzc2IbXWHGE8reoRSr98rRi8=
github.com/IBM/secret-common-lib v1.0.3/go.mod h1:uoYY5M9G1nJVT8ytPIicdTUujcBXKldBw7ijWolU0yU=
github.com/IBM/secret-utils-lib v1.0.2 h1:AdhKHo/bMmFLMz7+ZjnqSUHuU22CMQsG5meddvwKaV8=
Expand Down
5 changes: 4 additions & 1 deletion pkg/ibmcloudprovider/volume_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type IBMCloudStorageProvider struct {
var _ CloudProviderInterface = &IBMCloudStorageProvider{}

// NewIBMCloudStorageProvider ...
func NewIBMCloudStorageProvider(configPath string, logger *zap.Logger) (*IBMCloudStorageProvider, error) {
func NewIBMCloudStorageProvider(configPath string, clusterVolumeLabel string, logger *zap.Logger) (*IBMCloudStorageProvider, error) {
logger.Info("NewIBMCloudStorageProvider-Reading provider configuration...")
// Load config file
conf, err := config.ReadConfig(configPath, logger)
Expand Down Expand Up @@ -80,6 +80,9 @@ func NewIBMCloudStorageProvider(configPath string, logger *zap.Logger) (*IBMClou
logger.Info("Fetched clusterInfo..")
}

//Initialize the clusterVolumeLabel once which will be used for tagging by the library.
conf.VPC.ClusterVolumeLabel = clusterVolumeLabel

// Update the CSRF Token
if conf.Bluemix.PrivateAPIRoute != "" {
conf.Bluemix.CSRFToken = string([]byte{}) // TODO~ Need to remove it
Expand Down
2 changes: 1 addition & 1 deletion pkg/ibmcloudprovider/volume_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestNewIBMCloudStorageProvider(t *testing.T) {
}

configPath := filepath.Join(pwd, "..", "..", "test-fixtures", "slconfig.toml")
ibmCloudProvider, err := NewIBMCloudStorageProvider(configPath, logger)
ibmCloudProvider, err := NewIBMCloudStorageProvider(configPath, "test", logger)
assert.NotNil(t, err)
assert.Nil(t, ibmCloudProvider)
}
Expand Down

0 comments on commit 2c07e65

Please sign in to comment.