@@ -31,7 +31,7 @@ const (
3131
3232 // Prefix for services section. It is referenced in profile via the services
3333 // parameter to configure clients for service-specific parameters.
34- servicesPrefix = `services`
34+ servicesPrefix = `services `
3535
3636 // string equivalent for boolean
3737 endpointDiscoveryDisabled = `false`
@@ -109,6 +109,8 @@ const (
109109
110110 endpointURL = "endpoint_url"
111111
112+ servicesSectionKey = "services"
113+
112114 disableRequestCompression = "disable_request_compression"
113115 requestMinCompressionSizeBytes = "request_min_compression_size_bytes"
114116
@@ -320,8 +322,9 @@ type SharedConfig struct {
320322 // corresponding endpoint resolution field.
321323 BaseEndpoint string
322324
323- // Value to contain services section content.
324- Services Services
325+ // Services section config.
326+ ServicesSectionName string
327+ Services Services
325328
326329 // determine if request compression is allowed, default to false
327330 // retrieved from config file's profile field disable_request_compression
@@ -1007,14 +1010,11 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile
10071010 c .SSOSession = & ssoSession
10081011 }
10091012
1010- for _ , sectionName := range sections .List () {
1011- if strings .HasPrefix (sectionName , servicesPrefix ) {
1012- section , ok := sections .GetSection (sectionName )
1013- if ok {
1014- var svcs Services
1015- svcs .setFromIniSection (section )
1016- c .Services = svcs
1017- }
1013+ if len (c .ServicesSectionName ) > 0 {
1014+ if section , ok := sections .GetSection (servicesPrefix + c .ServicesSectionName ); ok {
1015+ var svcs Services
1016+ svcs .setFromIniSection (section )
1017+ c .Services = svcs
10181018 }
10191019 }
10201020
@@ -1136,6 +1136,8 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er
11361136 c .Credentials = creds
11371137 }
11381138
1139+ updateString (& c .ServicesSectionName , section , servicesSectionKey )
1140+
11391141 return nil
11401142}
11411143
0 commit comments