You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently remote.NewRepository("myreg/myrepo") returns a remote.Repository object
but i use reg, err := remote.NewRegistry("myreg") and then call reg.Repository("myrepo") it returns a registry.Repository interface.
Unfortunately this interface is missing the Predecessors() method which means that it does not implement the content.ReadOnlyGraphStorage
this means that while i can use content.CopyGraph, i cannot use content.ExtendedCopyGraph
The text was updated successfully, but these errors were encountered:
Thank @JefeDavis for mentioning this.
It is a breaking change to introduce content.PredecessorFinder in the Repository interface. Therefore, the change cannot be introduced to oras-go v2.
As a workaround, you can do type casting like
reg, err:=remote.NewRegistry("myreg")
iferr!=nil {
// handle error
}
repo, err:=reg.Repository("myrepo")
iferr!=nil {
// handle error
}
target, ok:=repo.(content.GraphTarget)
if!ok {
// handle exception// note that *remote.Repository implements oras.GraphTarget
}
// use target with Copy or ExtendedCopy
This issue is stale because it has been open for 60 days with no activity. Remove the stale label or comment to prevent it from being closed in 30 days.
currently
remote.NewRepository("myreg/myrepo")
returns a remote.Repository objectbut i use
reg, err := remote.NewRegistry("myreg")
and then callreg.Repository("myrepo")
it returns a registry.Repository interface.Unfortunately this interface is missing the
Predecessors()
method which means that it does not implement the content.ReadOnlyGraphStoragethis means that while i can use
content.CopyGraph
, i cannot usecontent.ExtendedCopyGraph
The text was updated successfully, but these errors were encountered: