Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xiujie.1 committed Dec 2, 2024
1 parent 11b032b commit 5cdfaf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion volcengine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,13 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
// c.DisableEndpointHostPrefix = &t
// return c
//}

// WithEndpointConfigState will set whether or not to use FileEndpointResolver
func (c *Config) WithEndpointConfigState(t bool) *Config {
c.EndpointConfigState = &t
return c
}

// WithEndpointConfigPath will set fileEndpointResolver config path . This takes effect when EndpointConfigState is true.
func (c *Config) WithEndpointConfigPath(path string) *Config {
c.EndpointConfigPath = &path
return c
Expand Down
6 changes: 3 additions & 3 deletions volcengine/session/env_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ type envConfig struct {
//
// VOLCSTACK_ENABLE_ENDPOINT_CONFIG_STATE=session_name
EndpointConfigState *bool
endpointConfigState string
// Specifies the endpoint config file path
//
// VOLCSTACK_ENDPOINT_CONFIG_FILE=session_name
Expand Down Expand Up @@ -270,9 +269,10 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
if len(cfg.enableEndpointDiscovery) > 0 {
cfg.EnableEndpointDiscovery = volcengine.Bool(cfg.enableEndpointDiscovery != "false")
}
setFromEnvVal(&cfg.endpointConfigState, enableEndpointConfigStateEnvKey)
var endpointConfigState string
setFromEnvVal(&endpointConfigState, enableEndpointConfigStateEnvKey)
if len(cfg.enableEndpointDiscovery) > 0 {
cfg.EndpointConfigState = volcengine.Bool(cfg.endpointConfigState != "false")
cfg.EndpointConfigState = volcengine.Bool(endpointConfigState != "false")
}
setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)
Expand Down

0 comments on commit 5cdfaf5

Please sign in to comment.