Skip to content

Commit 3779ae8

Browse files
committed
fix: small config upgrade improvements
1 parent 5985ae4 commit 3779ae8

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

pkg/devspace/build/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ func (c *controller) waitForBuild(ctx *devspacecontext.Context, errChan <-chan e
304304
case err := <-errChan:
305305
return err
306306
case done := <-cacheChan:
307+
ctx := ctx.WithLogger(logpkg.NewDefaultPrefixLogger("build:"+done.imageConfigName+" ", ctx.Log))
307308
ctx.Log.Donef("Done building image %s:%s (%s)", done.imageName, done.imageTag, done.imageConfigName)
308309

309310
// Update cache

pkg/devspace/config/versions/v1beta11/upgrade.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"github.com/loft-sh/devspace/pkg/util/encoding"
99
"github.com/loft-sh/devspace/pkg/util/log"
1010
"k8s.io/apimachinery/pkg/labels"
11+
"os"
12+
"path/filepath"
1113
"strings"
1214
)
1315

@@ -28,7 +30,13 @@ func (c *Config) Upgrade(log log.Logger) (config.Config, error) {
2830

2931
// just guess a name here
3032
if nextConfig.Name == "" {
31-
nextConfig.Name = "devspace"
33+
// try to get current folder name
34+
wd, _ := os.Getwd()
35+
if wd != "" && filepath.Base(wd) != "" && len(filepath.Base(wd)) > 2 {
36+
nextConfig.Name = filepath.Base(wd)
37+
} else {
38+
nextConfig.Name = "devspace"
39+
}
3240
}
3341

3442
// use a pretty simple pipeline which was used by devspace before

pkg/devspace/deploy/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func (c *controller) Purge(ctx *devspacecontext.Context, deployments []string) e
309309
continue
310310
}
311311
}
312-
ctx = ctx.WithLogger(log.NewDefaultPrefixLogger("purge:"+deploymentCache.Name+" ", ctx.Log))
312+
ctx := ctx.WithLogger(log.NewDefaultPrefixLogger("purge:"+deploymentCache.Name+" ", ctx.Log))
313313

314314
// Execute before deployment purge hook
315315
err = hook.ExecuteHooks(ctx, map[string]interface{}{

pkg/devspace/services/targetselector/until_newest_running.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ func (u *PodInfoPrinter) PrintPodInfo(client kubectl.Client, pod *v1.Pod, log lo
130130

131131
status := kubectl.GetPodStatus(pod)
132132
u.shownEvents = displayWarnings(relevantObjectsFromPod(pod), pod.Namespace, client, u.shownEvents, log)
133-
log.Infof("DevSpace is waiting, because Pod %s has status: %s", pod.Name, status)
133+
if status != "Running" {
134+
log.Infof("DevSpace is waiting, because Pod %s has status: %s", pod.Name, status)
135+
}
134136
u.LastWarning = time.Now()
135137
}
136138
}

0 commit comments

Comments
 (0)