@@ -188,6 +188,8 @@ func configFromEnv() (cfg Config, ok bool) {
188188 cfg .Global .Username = os .Getenv ("OS_USERNAME" )
189189 cfg .Global .Password = os .Getenv ("OS_PASSWORD" )
190190 cfg .Global .Region = os .Getenv ("OS_REGION_NAME" )
191+ cfg .Global .UserId = os .Getenv ("OS_USER_ID" )
192+ cfg .Global .TrustId = os .Getenv ("OS_TRUST_ID" )
191193
192194 cfg .Global .TenantId = os .Getenv ("OS_TENANT_ID" )
193195 if cfg .Global .TenantId == "" {
@@ -211,7 +213,7 @@ func configFromEnv() (cfg Config, ok bool) {
211213 cfg .Global .Username != "" &&
212214 cfg .Global .Password != "" &&
213215 (cfg .Global .TenantId != "" || cfg .Global .TenantName != "" ||
214- cfg .Global .DomainId != "" || cfg .Global .DomainName != "" )
216+ cfg .Global .DomainId != "" || cfg .Global .DomainName != "" || cfg . Global . Region != "" || cfg . Global . UserId != "" || cfg . Global . TrustId != "" )
215217
216218 cfg .Metadata .SearchOrder = fmt .Sprintf ("%s,%s" , configDriveID , metadataID )
217219 cfg .BlockStorage .BSVersion = "auto"
@@ -671,7 +673,7 @@ func (os *OpenStack) Routes() (cloudprovider.Routes, bool) {
671673 }
672674
673675 if ! netExts ["extraroute" ] {
674- glog .V (3 ).Infof ("Neutron extraroute extension not found, required for Routes support" )
676+ glog .V (3 ).Info ("Neutron extraroute extension not found, required for Routes support" )
675677 return nil , false
676678 }
677679
@@ -704,39 +706,39 @@ func (os *OpenStack) volumeService(forceVersion string) (volumeService, error) {
704706 if err != nil {
705707 return nil , err
706708 }
707- glog .V (3 ).Infof ("Using Blockstorage API V1" )
709+ glog .V (3 ).Info ("Using Blockstorage API V1" )
708710 return & VolumesV1 {sClient , os .bsOpts }, nil
709711 case "v2" :
710712 sClient , err := os .NewBlockStorageV2 ()
711713 if err != nil {
712714 return nil , err
713715 }
714- glog .V (3 ).Infof ("Using Blockstorage API V2" )
716+ glog .V (3 ).Info ("Using Blockstorage API V2" )
715717 return & VolumesV2 {sClient , os .bsOpts }, nil
716718 case "v3" :
717719 sClient , err := os .NewBlockStorageV3 ()
718720 if err != nil {
719721 return nil , err
720722 }
721- glog .V (3 ).Infof ("Using Blockstorage API V3" )
723+ glog .V (3 ).Info ("Using Blockstorage API V3" )
722724 return & VolumesV3 {sClient , os .bsOpts }, nil
723725 case "auto" :
724726 // Currently kubernetes support Cinder v1 / Cinder v2 / Cinder v3.
725727 // Choose Cinder v3 firstly, if kubernetes can't initialize cinder v3 client, try to initialize cinder v2 client.
726728 // If kubernetes can't initialize cinder v2 client, try to initialize cinder v1 client.
727729 // Return appropriate message when kubernetes can't initialize them.
728730 if sClient , err := os .NewBlockStorageV3 (); err == nil {
729- glog .V (3 ).Infof ("Using Blockstorage API V3" )
731+ glog .V (3 ).Info ("Using Blockstorage API V3" )
730732 return & VolumesV3 {sClient , os .bsOpts }, nil
731733 }
732734
733735 if sClient , err := os .NewBlockStorageV2 (); err == nil {
734- glog .V (3 ).Infof ("Using Blockstorage API V2" )
736+ glog .V (3 ).Info ("Using Blockstorage API V2" )
735737 return & VolumesV2 {sClient , os .bsOpts }, nil
736738 }
737739
738740 if sClient , err := os .NewBlockStorageV1 (); err == nil {
739- glog .V (3 ).Infof ("Using Blockstorage API V1" )
741+ glog .V (3 ).Info ("Using Blockstorage API V1" )
740742 return & VolumesV1 {sClient , os .bsOpts }, nil
741743 }
742744
0 commit comments