-
Notifications
You must be signed in to change notification settings - Fork 21
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: target option to disable extra identity defaulting in transport tool #1223
Conversation
While this PR is important to fix newly transferred resources, existing component versions that had this defaulting happen need to have the same hash in v1 & v2 as they otherwise would break signature calculation. This is why v3 is necessary in addition to this defaulting change which was forgotten in the original PR for defaulting. |
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.
This fix looks mostly good, just the variable name is problematic for me.
I checked current main out and cannot actually reproduce the extra identity defaulting happening during transport. I dont know how you did it, but I couldnt replicate the apparent fixable behavior. If I transfer
from e.g. a component archive to a OCI registry, I cannot see any extra identity default:
How is this additional case triggered? |
I did the following:
Because v18 was used to create the ctf, there is no explicit extra identity.
This already uses the PR you unfortunately already merged.
As you can see, as expected, there is the extra identity, now. You PR does not fix anything related to the root cause. |
Im starting to realize this is a different bug now. Even though you are correct with the identity defaulting on this specific component, the component version that was reported in the bug looks different after transport - access:
imageReference: ...
digest: null
extraIdentity: {}
labels: ...
name: nginx-ingress-controller
relation: external
srcRefs: []
type: ociImage
version: v1.11.3
- access:
imageReference: ...
type: ociRegistry
digest: null
extraIdentity: {}
labels: ...
name: nginx-ingress-controller
relation: external
srcRefs: []
type: ociImage
version: v1.9.6 I think you are fixing a bug, but not a bug thats related to the report. |
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.
Double checked: The bug cannot be related to transport because the team that reported it didnt use OCM for transfer, thus the bugs are not correlated. Nevertheless, this bug is valid and the fix here should be merged
Yes, that is what I also discovered yesterday, there are indeed two bugs, I added this to the issue. But both bugs are not related to the normalization, but the to the defaulting of the version for the extraIdentity. The one reported in the issue, was just uncovered by v19 but was in the code since a very long time. |
closing in favor of #1236 |
…1236) <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it replaces #1223 as it does not contain the revert for the normalization algorithm Introduces DisableExtraIdentityDefaulting which is enabled by default during transport because IsModifyElement is not enough to differentiate if the component version is allowed to be modified during transfer. #### Which issue(s) this PR fixes PR that tackles a case in which `ocm transfer cv` caused accidental defaults to the extra identity. --------- Co-authored-by: Uwe Krueger <[email protected]>
…pen-component-model#1236) <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it replaces open-component-model#1223 as it does not contain the revert for the normalization algorithm Introduces DisableExtraIdentityDefaulting which is enabled by default during transport because IsModifyElement is not enough to differentiate if the component version is allowed to be modified during transfer. #### Which issue(s) this PR fixes PR that tackles a case in which `ocm transfer cv` caused accidental defaults to the extra identity. --------- Co-authored-by: Uwe Krueger <[email protected]>
…pen-component-model#1236) <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it replaces open-component-model#1223 as it does not contain the revert for the normalization algorithm Introduces DisableExtraIdentityDefaulting which is enabled by default during transport because IsModifyElement is not enough to differentiate if the component version is allowed to be modified during transfer. #### Which issue(s) this PR fixes PR that tackles a case in which `ocm transfer cv` caused accidental defaults to the extra identity. --------- Co-authored-by: Uwe Krueger <[email protected]>
…1236) (#1237) <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it replaces #1223 as it does not contain the revert for the normalization algorithm Introduces DisableExtraIdentityDefaulting which is enabled by default during transport because IsModifyElement is not enough to differentiate if the component version is allowed to be modified during transfer. #### Which issue(s) this PR fixes PR that tackles a case in which `ocm transfer cv` caused accidental defaults to the extra identity. --------- <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Backports this change to v0.19 as it occurred there first #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Ensures Transports also dont default with 0.19.z Co-authored-by: Uwe Krueger <[email protected]>
What this PR does / why we need it
The rework of the extra identity handling unfortunately also changed the transport logic.
Setting a (re)source for a new component version now defaults the version attribute of the extra identity if it is required
to make the identity unique. This was the first step towards getting rid of this implicit identity creation incorporating
the resource's version attribute into the effective extra identity. It makes this explicit, if the version is required as part of the identity of an element, it should be explicitly set for the extra identity in the future.
This defaulting has been made explicit by manipulating the extra identity when adding a new (re)resource. It was enabled by the modification option, which basically allows to do signature relevant changes.
Unfortunately this option is also used by the transport tool, after checking the delta to compose the target version.
Therefore, the transport now explicitly defaults the version into the extra identity, which causes the signature to break.
The solution is disable this defaulting for the transport. Therefore the methods accept a new option now (
DisableExtraIdentityDefaulting
), which tells the add handling to omit the defaulting and take the meta data as presented.Which issue(s) this PR fixes
Does not default extra Identity when using ocm for transfer