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

Adding uname name mapping for x86_64 in hack/install.sh #7917

Merged
merged 3 commits into from May 14, 2024

Conversation

Leo6Leo
Copy link
Member

@Leo6Leo Leo6Leo commented May 10, 2024

2024/05/10 13:56:47 Using base gcr.io/distroless/static:nonroot@sha256:e9ac71e2b8e279a8372741b7a0293afda17650d926900233ec3a7b2b7c22a246 for knative.dev/eventing/cmd/in_memory/channel_controller
Error: error processing import paths in "config/channels/in-memory-channel/deployments/dispatcher.yaml": error resolving image references: no matching platforms in base image index

In the hack/install.sh script, the uname -m gives x86_64 for the arch, but ko requires amd64

Proposed Changes

  • Adding the name mapping that handles the platform argument in the KO_FLAGS variable

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note


Docs

@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/test-and-release Test infrastructure, tests or release labels May 10, 2024
@Leo6Leo
Copy link
Member Author

Leo6Leo commented May 10, 2024

/cc @Cali0707

@knative-prow knative-prow bot requested a review from Cali0707 May 10, 2024 18:18
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.33%. Comparing base (7e1c082) to head (6108dec).
Report is 44 commits behind head on main.

❗ Current head 6108dec differs from pull request most recent head 429d73b. Consider uploading reports for the commit 429d73b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7917      +/-   ##
==========================================
+ Coverage   69.22%   69.33%   +0.11%     
==========================================
  Files         339      344       +5     
  Lines       19494    15911    -3583     
==========================================
- Hits        13494    11032    -2462     
+ Misses       5337     4197    -1140     
- Partials      663      682      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

hack/install.sh Outdated
Comment on lines 27 to 34
ARCH=$(uname -m)
case "$ARCH" in
x86_64) KO_ARCH="amd64" ;;
arm64) KO_ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH" && exit 1 ;;
esac

export KO_FLAGS=${KO_FLAGS:-"--platform=linux/$KO_ARCH"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Leo6Leo now that I think about this a bit more, I think maybe a better approach would be to check the architecture from go env, as that would match the name of the architecture used by ko.

Maybe something like:

go env -json | jq .GOARCH -r

But, this would add a dependency on jq 🤷

@pierDipi @creydr any ideas/opinions?

Copy link
Member

@pierDipi pierDipi May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is without jq

$ go env | grep GOARCH | awk -F\' '{print $2}'
amd64

@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 14, 2024
@Leo6Leo
Copy link
Member Author

Leo6Leo commented May 14, 2024

/cc @pierDipi @Cali0707 @creydr

Signed-off-by: Leo Li <leoli@redhat.com>
Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks for fixing this @Leo6Leo !

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2024
Copy link

knative-prow bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, Leo6Leo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2024
@knative-prow knative-prow bot merged commit 884f0da into knative:main May 14, 2024
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants