-
Notifications
You must be signed in to change notification settings - Fork 191
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
Switch from crane
package to remote
#1244
Switch from crane
package to remote
#1244
Conversation
24d864b
to
3f16ef0
Compare
2e38d55
to
410396c
Compare
@@ -1867,7 +1878,7 @@ func TestOCIRepository_getArtifactURL(t *testing.T) { | |||
{ | |||
name: "valid url with no reference", | |||
url: "oci://ghcr.io/stefanprodan/charts", | |||
want: "ghcr.io/stefanprodan/charts", | |||
want: "ghcr.io/stefanprodan/charts:latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanprodan @hiddeco the tests are passing locally, this is the only real change of a test case that I had to make that might be significant.
@stefanprodan you mentioned retry logic is important. I cannot see it being configured in the code, so I wonder if there is something hidden in |
Looks like it is setup here: https://github.com/google/go-containerregistry/blob/dbcd01c402b2f05bcf6fb988014c5f37e9b13559/pkg/v1/remote/options.go#L166C2-L166C2 |
crane
package to remote
(WIP)crane
package to remote
410396c
to
b2c4f51
Compare
I squashed WIP commits into one, it's ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Really nice refactoring! Thanks @errordeveloper 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @errordeveloper. 💯
`crane` package is the highest level of abstraction that GGCR provides, it's easy to use, however it doesn't give user much control. This change moves `OCIRepository` controller logic to a lower-level `remote` package and makes handling of references more explicit with `name.Repository`, `name.Digest` and `name.Tag`. It also simplifies options builder, as there is no need to have separate sets of options for cosign and crane. Signed-off-by: Ilya Dmitrichenko <[email protected]>
b2c4f51
to
a5ec631
Compare
Signed-off-by: Ilya Dmitrichenko [email protected]