Skip to content

Conversation

djdongjin
Copy link
Member

@djdongjin djdongjin commented Nov 10, 2024

Fix #10959

In current cri runtime config migration, it only changes sandbox_mode to sandboxer but left fields that are already moved to cri image/grpc services in place. That causes confusing WARN from toml parsing for cri runtime config, because those leftover cri image/grpc config fields don't have entries in Runtime config struct.

This PR explicitly skips those fields that are moved to cri image/grpc during cri runtime config migration, thus avoiding the WARNs.


Test using the 1.7 default config.toml

After this PR:

Notice these warnings are expected, because they are all deprecated.

$ sudo ./bin/containerd --config integration/client/testdata/default-1.7.toml config migrate
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=disable_cgroup plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=systemd_cgroup plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd no_pivot" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd default_runtime" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd default_runtime options" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd runtimes runc runtime_engine" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd runtimes runc runtime_root" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd untrusted_workload_runtime" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd untrusted_workload_runtime options" plugin=io.containerd.cri.v1.runtime

On main branch:

Notice the warnings are more, including fields that are deprecated, AND are moved to cri runtime/grpc service configs.

WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=disable_cgroup plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=disable_tcp_service plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=enable_tls_streaming plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=image_pull_progress_timeout plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=max_concurrent_downloads plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=sandbox_image plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=stats_collect_period plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=stream_idle_timeout plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=stream_server_address plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=stream_server_port plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=systemd_cgroup plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd disable_snapshot_annotations" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd discard_unpacked_layers" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd no_pivot" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd snapshotter" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd default_runtime" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd default_runtime options" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd runtimes runc runtime_engine" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd runtimes runc runtime_root" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd runtimes runc sandbox_mode" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd untrusted_workload_runtime" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="containerd untrusted_workload_runtime options" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=image_decryption plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=registry plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="registry auths" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="registry configs" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="registry headers" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key="registry mirrors" plugin=io.containerd.cri.v1.runtime
WARN[0000] Ignoring unknown key in TOML for plugin       error="strict mode: fields in the document are missing in the target struct" key=x509_key_pair_streaming plugin=io.containerd.cri.v1.runtime

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@djdongjin
Copy link
Member Author

/test all

@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch 3 times, most recently from 59dcd6b to fae7c34 Compare November 25, 2024 02:19
@djdongjin djdongjin changed the title improve-cri-runtime-config-migration Improve CRI runtime config migration Nov 25, 2024
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch 2 times, most recently from 53f74e9 to 2a0bdee Compare November 25, 2024 02:57
@djdongjin djdongjin marked this pull request as ready for review November 25, 2024 03:00
@dosubot dosubot bot added the area/cri Container Runtime Interface (CRI) label Nov 25, 2024
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch from 2a0bdee to 3a25e7b Compare November 25, 2024 03:07
@djdongjin
Copy link
Member Author

cc @rata @AkihiroSuda

@djdongjin
Copy link
Member Author

/test pull-containerd-node-e2e

@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch from 3a25e7b to 7a118cb Compare November 25, 2024 13:10
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch 2 times, most recently from 0dd5e24 to 7913322 Compare January 8, 2025 03:43
@djdongjin djdongjin changed the title Improve CRI runtime config migration Remove confusing warning in cri runtime config migration Jan 8, 2025
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch from 7913322 to 398022a Compare January 8, 2025 03:49
@djdongjin
Copy link
Member Author

Hi @AkihiroSuda when you have some time could you PTAL this PR? This removes unnecessary WARN from cri runtime config migration.

It was reported in a few issues (#10959, #11221 (comment)).

thank you!

@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch from 398022a to 793b773 Compare January 8, 2025 13:10
@AkihiroSuda AkihiroSuda requested a review from dmcgowan January 8, 2025 21:33
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch 2 times, most recently from 6c092dc to 023badb Compare January 9, 2025 02:01
@djdongjin
Copy link
Member Author

/test pull-containerd-k8s-e2e-ec2

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
@djdongjin djdongjin force-pushed the improve-cri-runtime-config-migration branch from 023badb to fb44e37 Compare January 12, 2025 02:38
@djdongjin
Copy link
Member Author

/retest-required

@AkihiroSuda AkihiroSuda added this pull request to the merge queue Jan 13, 2025
Merged via the queue into containerd:main with commit da3d55a Jan 13, 2025
59 checks passed
@djdongjin
Copy link
Member Author

Hi @dmcgowan @AkihiroSuda thanks for reviewing. Do we need to cherrypick this to release/2.0?

@AkihiroSuda
Copy link
Member

/cherry-pick release/2.0

@AkihiroSuda AkihiroSuda added the cherry-pick/2.0.x Change to be cherry picked to release/2.0 branch label Jan 13, 2025
@k8s-infra-cherrypick-robot

@AkihiroSuda: new pull request created: #11256

In response to this:

/cherry-pick release/2.0

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) cherry-pick/2.0.x Change to be cherry picked to release/2.0 branch size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning "Ignoring unknown key in TOML for plugin" is shown when starting containerd 2.0 with version 2 config
5 participants