Skip to content

Commit

Permalink
Rename NSM_CONNECT_TIMEOUT to NSM_DIAL_TIMEOUT
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <[email protected]>
  • Loading branch information
Vladimir Popov committed Jan 19, 2021
1 parent 07a440f commit aa38cfc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This README will provide directions for building, testing, and debugging that co

* NSM_NAME - A string value of network service client name (default "nsc")
* NSM_CONNECT_TO - A Network service Manager connectTo URL (default "unix:///var/lib/networkservicemesh/nsm.io.sock")
* NSM_CONNECT_TIMEOUT - A timeout to connect to Network Service Manager (default 5s)
* NSM_DIAL_TIMEOUT - A timeout to dial Network Service Manager (default 5s)
* NSM_REQUEST_TIMEOUT - A timeout to request Network Service Endpoint (default 5m)
* NSM_MAX_TOKEN_LIFETIME - A token lifetime duration (default 24h)
* NSM_LABELS - A list of client labels with format key1=val1,key2=val2, will be used a primary list for network services
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var configMechanisms = map[string]string{
type Config struct {
Name string `default:"nsc" desc:"Name of Network Service Client"`
ConnectTo url.URL `default:"unix:///var/lib/networkservicemesh/nsm.io.sock" desc:"url to connect to NSM" split_words:"true"`
ConnectTimeout time.Duration `default:"5s" desc:"timeout to connect to NSMgr" split_words:"true"`
DialTimeout time.Duration `default:"5s" desc:"timeout to dial NSMgr" split_words:"true"`
RequestTimeout time.Duration `default:"5m" desc:"timeout to request NSE" split_words:"true"`
MaxTokenLifetime time.Duration `default:"24h" desc:"maximum lifetime of tokens" split_words:"true"`

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func main() {
// ********************************************************************************
log.Entry(ctx).Infof("Performing cleanup of connections due terminate...")

ctx, cancel = context.WithTimeout(context.Background(), rootConf.ConnectTimeout)
ctx, cancel = context.WithTimeout(context.Background(), rootConf.DialTimeout)
defer cancel()

cleanup(ctx)
Expand All @@ -137,7 +137,7 @@ func nsmClientFactory(ctx context.Context, rootConf *config.Config) func(...netw
// ********************************************************************************
// Connect to NSManager
// ********************************************************************************
connectCtx, cancel := context.WithTimeout(ctx, rootConf.ConnectTimeout)
connectCtx, cancel := context.WithTimeout(ctx, rootConf.DialTimeout)
defer cancel()

log.Entry(ctx).Infof("NSC: Connecting to Network Service Manager %v", rootConf.ConnectTo.String())
Expand Down

0 comments on commit aa38cfc

Please sign in to comment.