Skip to content

Commit

Permalink
Fixes for failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rashad Sirajudeen <rashad.20@cse.mrt.ac.lk>
  • Loading branch information
rashadism committed May 8, 2024
1 parent 5b03e5b commit 2d0b90b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ benchmarks.test
# Jetbrains Goland
.idea/

# Visual Studio Code
.vscode

# Build outputs
artifacts/
.DS_Store

# Travis unencrypted file
.travis/key.pem

16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

10 changes: 4 additions & 6 deletions internal/build/lifecycle_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,12 @@ func (l *LifecycleExecution) Restore(ctx context.Context, buildCache Cache, kani

func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error {
var flags []string
var args []string

args = []string{l.opts.Image.String()}
args := []string{l.opts.Image.String()}

platformAPILessThan07 := l.platformAPI.LessThan("0.7")

cacheBindOp := NullOp()
if l.opts.ClearCache || l.opts.DetectOnly {
if l.opts.ClearCache || buildCache == nil {
if platformAPILessThan07 || l.platformAPI.AtLeast("0.9") {
args = prependArg("-skip-layers", args)
}
Expand All @@ -601,7 +599,7 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach
}

launchCacheBindOp := NullOp()
if l.platformAPI.AtLeast("0.9") && !l.opts.DetectOnly {
if l.platformAPI.AtLeast("0.9") && launchCache != nil {
if !l.opts.Publish {
args = append([]string{"-launch-cache", l.mountPaths.launchCacheDir()}, args...)
launchCacheBindOp = WithBinds(fmt.Sprintf("%s:%s", launchCache.Name(), l.mountPaths.launchCacheDir()))
Expand All @@ -616,7 +614,7 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCach
flags = append(flags, "-uid", strconv.Itoa(l.opts.UID))
}

if l.opts.PreviousImage != "" || !l.opts.DetectOnly {
if l.opts.PreviousImage != "" {
if l.opts.Image == nil {
return errors.New("image can't be nil")
}
Expand Down

0 comments on commit 2d0b90b

Please sign in to comment.