Skip to content

Commit 6e3f9e2

Browse files
committed
Use lambda function for filtering for installable artifacts.
Avoid changing more files with the upcoming runtime refactor.
1 parent 6e111b0 commit 6e3f9e2

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pkg/buildplan/filters.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,3 @@ func FilterSuccessfulArtifacts() FilterArtifact {
6565
a.Status == types.ArtifactReady
6666
}
6767
}
68-
69-
func FilterInstallableArtifacts() FilterArtifact {
70-
return func(a *Artifact) bool {
71-
return a.URL != ""
72-
}
73-
}

pkg/platform/runtime/setup/setup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,8 @@ func (s *Setup) fetchAndInstallArtifactsFromBuildPlan(bp *buildplan.BuildPlan, i
615615
}
616616

617617
buildReady := bp.IsBuildReady()
618-
if !buildReady && len(artifactsToInstall.Filter(buildplan.FilterSuccessfulArtifacts(), buildplan.FilterInstallableArtifacts())) == len(artifactsToInstall) {
618+
filterInstallable := func(a *buildplan.Artifact) bool { return a.URL != "" }
619+
if !buildReady && len(artifactsToInstall.Filter(buildplan.FilterSuccessfulArtifacts(), filterInstallable)) == len(artifactsToInstall) {
619620
// Even though the build may not be complete, all of the necessary artifacts are ready.
620621
buildReady = true
621622
}

0 commit comments

Comments
 (0)