-
Notifications
You must be signed in to change notification settings - Fork 0
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
Resource equivalence contract broken in version v0.6.0 #29
Comments
HI @mandelsoft , can you please have a look at this? |
The new equivalence behaviour has been introduced to better control transports and delta transports. May be this could be improved by involving the access method, if no digest is found. But, the digests should now always be available, because they are always created when adding a resource |
Hi @Tomasz-Smelcerz-SAP, does the above answer from @mandelsoft help? |
Hi, Thanks for reply. |
@mandelsoft, can you please check Tomasz comment? |
Yes, the digest is optional. It is still possible to generate the digests on-the-fly, when they are required (during the signing process). But if the digests are not present, delta transports are not really possible, the overwrite is required. |
What happened:
We use the OCM library for creating and distributing component archives in the Kyma-CLI project.
When upgrading the version from
v0.4.0
tov0.6.0
I noticed that thepkg/contexts/ocm/compdesc.Resource.IsEquivalent()
method is gone.It looks like it's been replaced by a more sophisticated
Equivalent(e ElementMetaAccessor) equivalent.EqualState
method.The new method has a different contract though, and I think there may be a bug there.
First, two identical Resource object copies (without optional Digest) are not considered "equivalent" anymore.
Second, two different Resource object (without optional Digest) are considered "localHashEqual".
None of the available checks work for me.
What you expected to happen:
Equality check allows to determine if two Resource objects without Digests are equal/equivalent.
How to reproduce it (as minimally and precisely as possible):
I have provided a little demo with unit tests:
Anything else we need to know:
We test resources for equality/equivalence to avoid unnecessary repository pushes (when the content doesn't change).
Environment:
n/a
The text was updated successfully, but these errors were encountered: