Skip to content

Commit 29b88ea

Browse files
committed
run: Simplify GITDIR sourcing
Signed-off-by: Paulo Gomes <[email protected]>
1 parent 64ee717 commit 29b88ea

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

internal/env/env.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package env
22

33
import (
44
"fmt"
5+
"log/slog"
56
"os"
67
)
78

@@ -16,6 +17,7 @@ var mapping = map[string]string{
1617
}
1718

1819
func Update(k, v string) error {
20+
slog.Debug("setting env", k, v)
1921
if _, ok := mapping[k]; ok {
2022
mapping[k] = v
2123
return nil

internal/qubesome/run.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,7 @@ func runner(in WorkloadInfo, runnerOverride string) error {
9191
return fmt.Errorf("profile %q does not exist", in.Profile)
9292
}
9393

94-
path := files.ProfileConfig(in.Profile)
95-
target, err := os.Readlink(path)
96-
if err != nil {
97-
slog.Debug("not able find profile path", "path", path, "error", err)
98-
return nil
99-
}
100-
101-
gitdir := filepath.Dir(filepath.Dir(target))
102-
err = env.Update("GITDIR", gitdir)
94+
err := env.Update("GITDIR", in.Config.RootDir)
10395
if err != nil {
10496
return err
10597
}

internal/runners/podman/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ func Run(ew types.EffectiveWorkload) error {
236236

237237
src := env.Expand(ps[0])
238238
if _, err := os.Stat(src); err != nil {
239-
slog.Warn("failed to mount path", "path", src, "error", err)
239+
slog.Warn("failed to mount path", "path", src, "error", err, "state", ps[0])
240240
continue
241241
}
242242

243243
dst := ps[1]
244-
args = append(args, fmt.Sprintf("-v=%s:%s:z", src, dst))
244+
args = append(args, fmt.Sprintf("-v=%s:%s", src, dst))
245245
}
246246

247247
args = append(args, wl.Image)

0 commit comments

Comments
 (0)