diff --git a/cmd/open.go b/cmd/open.go index 70b7dc0ab4..14c089029f 100644 --- a/cmd/open.go +++ b/cmd/open.go @@ -258,11 +258,15 @@ func openURL(url string, kubectlClient kubectl.Client, analyzeNamespace string, for time.Since(now) < maxWait { // Check if domain is ready => ignore error as we will retry request resp, _ := http.Get(url) - if resp != nil && resp.StatusCode != http.StatusBadGateway && resp.StatusCode != http.StatusServiceUnavailable { - time.Sleep(time.Second * 1) - _ = open.Start(url) - log.Donef("Successfully opened %s", url) - return nil + if resp != nil { + statusCode := resp.StatusCode + _ = resp.Body.Close() + if statusCode != http.StatusBadGateway && statusCode != http.StatusServiceUnavailable { + time.Sleep(time.Second * 1) + _ = open.Start(url) + log.Donef("Successfully opened %s", url) + return nil + } } if kubectlClient != nil && analyzeNamespace != "" { diff --git a/pkg/devspace/build/builder/restart/restart.go b/pkg/devspace/build/builder/restart/restart.go index 2a3762fd88..4c611dda9b 100644 --- a/pkg/devspace/build/builder/restart/restart.go +++ b/pkg/devspace/build/builder/restart/restart.go @@ -183,6 +183,7 @@ func loadRestartHelper(path, defaultScript string) (string, error) { if err != nil { return "", err } + defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil {