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

Fix arm64 update check issue #1433

Merged
merged 1 commit into from
Jan 18, 2024
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
9 changes: 9 additions & 0 deletions octo/buildpack_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func ContributeBuildpackDependencies(descriptor Descriptor) ([]Contribution, err
Run: StatikString("/update-buildpack-dependency.sh"),
Env: map[string]string{
"ID": d.Id,
"ARCH": safeGetArch(d),
"SHA256": "${{ steps.dependency.outputs.sha256 }}",
"URI": "${{ steps.dependency.outputs.uri }}",
"VERSION": "${{ steps.dependency.outputs.version }}",
Expand Down Expand Up @@ -108,3 +109,11 @@ Bumps %[1]s from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpa

return contributions, nil
}

func safeGetArch(d Dependency) string {
if arch, ok := d.With["arch"]; ok {
return arch.(string)
}

return ""
}
2 changes: 1 addition & 1 deletion octo/statik/statik.go

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions octo/update-buildpack-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

set -euo pipefail

OLD_VERSION=$(yj -tj < buildpack.toml | jq -r "
.metadata.dependencies[] |
select( .id == env.ID ) |
select( .version | test( env.VERSION_PATTERN ) ) |
.version")
OLD_VERSION=$(yj -tj < buildpack.toml | \
jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) ) | select( .purl | contains( env.ARCH ) )")

update-buildpack-dependency \
--buildpack-toml buildpack.toml \
Expand Down
Loading