-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 runtime platform loading in cri image plugin init #11165
base: main
Are you sure you want to change the base?
Fix runtime platform loading in cri image plugin init #11165
Conversation
5a4e576
to
62689c4
Compare
The cri image service init has a bug where, after getting FSPath for snapshotter_i, it stores it under defaultSnapshotter instead of snapshotter_i. Also make a few other refactor: 1. Dedup the snapshotRoot loading for defaultSnapshotter 2. Remove some unnecessary logic in RuntimePlatforms for-loop Signed-off-by: Jin Dong <[email protected]>
62689c4
to
ef0e709
Compare
if s, ok := options.Snapshotters[defaultSnapshotter]; ok { | ||
options.Snapshotters[defaultSnapshotter] = s | ||
} else { | ||
return nil, fmt.Errorf("failed to find snapshotter %q", defaultSnapshotter) | ||
} |
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.
I am not sure if this is only needed for defaultSnapshotter
(if so this is noop and we can remove since we've done this at line 94-98.
Or is this also a bug? (i.e., what we want is:
if s, ok := allSnapshotters[snapshotter]; ok {
options.Snapshotters[snapshotter] = s
} else {
return nil, fmt.Errorf("failed to find snapshotter %q", snapshotter)
}
(The options.Snapshotters
is only used by snapshotSyncer to sync snapshots to cri's snapshotStore. So with current logic, we're only doing this for the default snapshotter).
containerd/internal/cri/server/images/service.go
Lines 116 to 117 in 2207955
svc.snapshotStore, | |
options.Snapshotters, |
/test pull-containerd-k8s-e2e-ec2 |
cc @dmcgowan |
kindly ping @dmcgowan could you please PTAL this fix when you get some time? thanks! 😄 |
The cri image plugin init has a bug where, after getting FSPath for
snapshotter_i
, it always stores/overwrites it underoptions.ImageFSPaths[defaultSnapshotter]
instead.Also make a few other refactor:
Adding this to
config.toml
:After this change, in containerd log:
In main branch: