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: make image digest check more permissive #2510

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

lkingland
Copy link
Member

Makes the image digest check and validation a bit more permissive.

Fixes #2508

/kind bug

Fixes a bug where registries could sometimes not specify port

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 20, 2024
@knative-prow knative-prow bot requested review from dsimansk and vyasgun September 20, 2024 05:15
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.90%. Comparing base (c489f7f) to head (1be1e14).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2510      +/-   ##
==========================================
+ Coverage   61.47%   66.90%   +5.42%     
==========================================
  Files         129      130       +1     
  Lines       15381    12048    -3333     
==========================================
- Hits         9456     8061    -1395     
+ Misses       4990     3010    -1980     
- Partials      935      977      +42     
Flag Coverage Δ
e2e-test 36.52% <60.00%> (-0.08%) ⬇️
e2e-test-oncluster 33.36% <60.00%> (-0.07%) ⬇️
e2e-test-oncluster-runtime 29.70% <60.00%> (?)
e2e-test-runtime-go 26.56% <60.00%> (?)
e2e-test-runtime-node 25.95% <60.00%> (?)
e2e-test-runtime-python 25.95% <60.00%> (?)
e2e-test-runtime-quarkus 26.05% <60.00%> (?)
e2e-test-runtime-rust 25.08% <60.00%> (?)
e2e-test-runtime-springboot 25.13% <60.00%> (?)
e2e-test-runtime-typescript 26.04% <60.00%> (?)
integration-tests 53.04% <100.00%> (+2.33%) ⬆️
unit-tests 51.65% <100.00%> (?)
unit-tests-macos-latest ?
unit-tests-ubuntu-latest ?
unit-tests-windows-latest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

@gauron99 gauron99 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold @lkingland sorry didnt realize ports can be added to the name! thanks.

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2024
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2024
Copy link

knative-prow bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, lkingland

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

cmd/deploy_test.go Outdated Show resolved Hide resolved
@matejvasek
Copy link
Contributor

Couldn't we implement isDigested() as

func isDigested(v string) (validDigest bool, err error) {
        ref, err := name.ParseReference(v)
        if err != nil {
	        return false, err
        }
        _, ok := ref.(name.Digest)
        return ok, nil
}

or

func isDigested(v string) (validDigest bool, err error) {
        ref, err := reference.Parse(v)
        if err != nil {
	        return false, err
        }
        _, ok := ref.(reference.Digested)
        return ok, nil
}

?

cmd/deploy_test.go Outdated Show resolved Hide resolved
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2024
@lkingland
Copy link
Member Author

lkingland commented Sep 24, 2024

Couldn't we implement isDigested() as

func isDigested(v string) (validDigest bool, err error) {
        ref, err := name.ParseReference(v)

Yes, I prefer this; using an extant implementation when available.

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 24, 2024
@knative knative deleted a comment from knative-prow bot Sep 24, 2024
@matejvasek
Copy link
Contributor

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2024
@lkingland lkingland removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 24, 2024
@lkingland lkingland merged commit eb17ea7 into knative:main Sep 24, 2024
39 checks passed
@lkingland lkingland deleted the fix-digested-test branch September 26, 2024 00:28
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

func deploy doesn't support registry port
3 participants