Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default lifecycle values #1067

Merged
merged 1 commit into from
Feb 9, 2021
Merged
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
17 changes: 2 additions & 15 deletions internal/build/lifecycle_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ func (l *LifecycleExecution) Detect(ctx context.Context, networkMode string, vol
l,
WithLogPrefix("detector"),
WithArgs(
l.withLogLevel(
"-app", l.mountPaths.appDir(),
"-platform", l.mountPaths.platformDir(),
)...,
l.withLogLevel()...,
),
WithNetwork(networkMode),
WithBinds(volumes...),
Expand Down Expand Up @@ -283,7 +280,6 @@ func (l *LifecycleExecution) Restore(ctx context.Context, networkMode string, bu
WithArgs(
l.withLogLevel(
"-cache-dir", l.mountPaths.cacheDir(),
"-layers", l.mountPaths.layersDir(),
)...,
),
WithNetwork(networkMode),
Expand All @@ -307,7 +303,6 @@ func (l *LifecycleExecution) Analyze(ctx context.Context, repoName, networkMode

func (l *LifecycleExecution) newAnalyze(repoName, networkMode string, publish, clearCache bool, buildCache Cache, phaseFactory PhaseFactory) (RunnerCleaner, error) {
args := []string{
"-layers", l.mountPaths.layersDir(),
repoName,
}
if clearCache {
Expand Down Expand Up @@ -378,17 +373,11 @@ func (l *LifecycleExecution) newAnalyze(repoName, networkMode string, publish, c
}

func (l *LifecycleExecution) Build(ctx context.Context, networkMode string, volumes []string, phaseFactory PhaseFactory) error {
args := []string{
"-layers", l.mountPaths.layersDir(),
"-app", l.mountPaths.appDir(),
"-platform", l.mountPaths.platformDir(),
}

configProvider := NewPhaseConfigProvider(
"builder",
l,
WithLogPrefix("builder"),
WithArgs(l.withLogLevel(args...)...),
WithArgs(l.withLogLevel()...),
WithNetwork(networkMode),
WithBinds(volumes...),
)
Expand All @@ -410,9 +399,7 @@ func determineDefaultProcessType(platformAPI *api.Version, providedValue string)
func (l *LifecycleExecution) newExport(repoName, runImage string, publish bool, networkMode string, buildCache, launchCache Cache, additionalTags []string, phaseFactory PhaseFactory) (RunnerCleaner, error) {
flags := []string{
"-cache-dir", l.mountPaths.cacheDir(),
"-layers", l.mountPaths.layersDir(),
"-stack", l.mountPaths.stackPath(),
"-app", l.mountPaths.appDir(),
"-run-image", runImage,
}

Expand Down
12 changes: 0 additions & 12 deletions internal/build/lifecycle_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
h.AssertIncludeAllExpectedPatterns(t,
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-app", "/workspace"},
[]string{"-platform", "/platform"},
)
})

Expand Down Expand Up @@ -1023,7 +1021,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
h.AssertIncludeAllExpectedPatterns(t,
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-layers", "/layers"},
[]string{expectedRepoName},
)
})
Expand Down Expand Up @@ -1141,7 +1138,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-daemon"},
[]string{"-layers", "/layers"},
[]string{expectedRepoName},
)
})
Expand Down Expand Up @@ -1261,7 +1257,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-cache-dir", "/cache"},
[]string{"-layers", "/layers"},
)
})

Expand Down Expand Up @@ -1354,9 +1349,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
h.AssertIncludeAllExpectedPatterns(t,
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-layers", "/layers"},
[]string{"-app", "/workspace"},
[]string{"-platform", "/platform"},
)
})

Expand Down Expand Up @@ -1437,8 +1429,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-cache-dir", "/cache"},
[]string{"-layers", "/layers"},
[]string{"-app", "/workspace"},
[]string{"-run-image", expectedRunImage},
[]string{expectedRepoName},
)
Expand All @@ -1464,8 +1454,6 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {
configProvider.ContainerConfig().Cmd,
[]string{"-log-level", "debug"},
[]string{"-cache-dir", "/cache"},
[]string{"-layers", "/layers"},
[]string{"-app", "/workspace"},
[]string{"-run-image", expectedRunImage},
[]string{expectedRepoName, additionalTags[0], additionalTags[1]},
)
Expand Down
4 changes: 0 additions & 4 deletions internal/build/mount_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,3 @@ func (m mountPaths) cacheDir() string {
func (m mountPaths) launchCacheDir() string {
return m.join(m.volume, "launch-cache")
}

func (m mountPaths) platformDir() string {
return m.join(m.volume, "platform")
}