Skip to content

Commit

Permalink
Merge pull request #2 from SmartManoj/use-custom-timeout
Browse files Browse the repository at this point in the history
Signed-off-by: மனோஜ்குமார் பழனிச்சாமி <[email protected]>
  • Loading branch information
SmartManoj authored Jul 23, 2024
2 parents da9b66c + 9bbc6be commit f53736b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/networks/usernet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"strconv"
"time"

gvproxyclient "github.com/containers/gvisor-tap-vsock/pkg/client"
Expand Down Expand Up @@ -76,8 +77,11 @@ func (c *Client) ResolveAndForwardSSH(ipAddr string, sshPort int) error {

func (c *Client) ResolveIPAddress(ctx context.Context, vmMacAddr string) (string, error) {
timeout := 2 * time.Minute
if os.Getenv("GITHUB_ACTIONS") != "" {
timeout = 3 * time.Minute
customTimeout := os.Getenv("CUSTOM_TIMEOUT")
if customTimeout != "" {
if parsedTimeout, err := strconv.Atoi(customTimeout); err == nil {
timeout = time.Duration(parsedTimeout) * time.Minute
}
}
timeoutChan := time.After(timeout)
ticker := time.NewTicker(500 * time.Millisecond)
Expand Down

0 comments on commit f53736b

Please sign in to comment.