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 incorrect comment about ordering of parent layers #10343

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ambarve
Copy link
Contributor

@ambarve ambarve commented Jun 14, 2024

The ParentIDs array in the Snapshot type is populated in the reverse order i.e the immediate parent is at the 0th index and the oldest parent is at the last index. It can be seen here:
https://github.com/containerd/containerd/blob/main/core/snapshots/storage/bolt.go#L492 When applying these layers, the parent layer at the last index should be applied first and the parent layer at the 0th index should be applied last. However, the comment above the Snapshot type says the exact opposite thing. This commit fixes that comment.

@k8s-ci-robot
Copy link

Hi @ambarve. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

The ParentIDs array in the Snapshot type is populated in the reverse order i.e the
immediate parent is at the 0th index and the oldest parent is at the last index. It can be
seen here:
https://github.com/containerd/containerd/blob/main/core/snapshots/storage/bolt.go#L492
When applying these layers, the parent layer at the last index should be applied first and
the parent layer at the 0th index should be applied last. However, the comment above the
Snapshot type says the exact opposite thing.  This commit fixes that comment.

Signed-off-by: Amit Barve <ambarve@microsoft.com>
Copy link
Member

@henry118 henry118 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants