Skip to content

Commit f760b3a

Browse files
mhdawsonForestEckhardt
authored andcommitted
fix: restore ability to use occam with extensions
Recent change to support multi-arch for buildpacks brokle occam for extensions. This was because extensions were being built with "pack buildpack package" which seems to work for extensions if a tgz is passed in but not an expanded directory. Update to use "pack extension package" for extensions instead. Unfortunately pack does not yet seem to support multi-arch for extensions so we'll have to add the --target option for extensions after that has been added. Signed-off-by: Michael Dawson <mdawson@devrus.com>
1 parent 63a9e44 commit f760b3a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packagers/jam.go

+15-5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,21 @@ func (j Jam) Execute(buildpackDir, output, version string, offline bool) error {
106106

107107
}
108108

109-
args = []string{
110-
"buildpack", "package",
111-
output,
112-
"--format", "file",
113-
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
109+
if ( command == "--buildpack") {
110+
args = []string{
111+
"buildpack", "package",
112+
output,
113+
"--format", "file",
114+
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
115+
}
116+
} else {
117+
// pack extension does not yet support multi-arch
118+
// update to inclue --target once it does
119+
args = []string{
120+
"extension", "package",
121+
output,
122+
"--format", "file",
123+
}
114124
}
115125

116126
err = j.pack.Execute(pexec.Execution{

packagers/jam_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ func testJam(t *testing.T, context spec.G, it spec.S) {
109109
}))
110110

111111
Expect(pack.ExecuteCall.Receives.Execution.Args).To(Equal([]string{
112-
"buildpack", "package",
112+
"extension", "package",
113113
"some-output",
114114
"--format", "file",
115-
"--target", fmt.Sprintf("linux/%s", runtime.GOARCH),
116115
}))
117116
})
118117
})

0 commit comments

Comments
 (0)