Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
1 change: 1 addition & 0 deletions pkg/devspace/build/builder/restart/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down