-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Validate userns container config is consistent with sandbox userns config #7882
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
Validate userns container config is consistent with sandbox userns config #7882
Conversation
Currently we require that c.containerSpec() does not return an error if test.err is not set. However, if the require fails (i.e. it indeed returned an error) the rest of the code is executed anyways. The rest of the code assumes it did not return an error (so code assumes spec is not nil). This fails miserably if it indeed returned an error, as spec is nil and go crashes while running the unit tests. Let's require it is not an error, so code does not continue to execute if that fails and go doesn't crash. In the test.err case is not harmful the bug of using assert, but let's switch it to require too as that is what we really want. Signed-off-by: Rodrigo Campos <[email protected]>
|
Hi @rata. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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/test-infra repository. |
The sandbox and container both have the userns config. Lets make sure they are the same, therefore consistent. Signed-off-by: Rodrigo Campos <[email protected]>
56b5946 to
2752da6
Compare
Signed-off-by: Rodrigo Campos <[email protected]>
2752da6 to
72ef986
Compare
|
CI failures are unrelated, but pushing again to trigger a retest |
|
/ok-to-test |
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
… main Updates ADO containerd fork-external/main with upstream containerd main @commit hash: f9f8455 containerd@f9f8455 Additional changes in the PR: - update linux container image version - remove copying LICENSE file in shared-build-stages.yml - additions to .gdnsuppress Related work items: containerd#5674, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7879, containerd#7880, containerd#7881, containerd#7882, containerd#7883, containerd#7886, containerd#7887, containerd#7888, containerd#7891, containerd#7892, containerd#7893, containerd#7894, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7960, containerd#7963, containerd#7969, containerd#7970, containerd#7973
…/main Update fork-external/main with upstream containerd/containerd/main at commit hash 3d32da8 Related work items: containerd#5674, containerd#7129, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7882, containerd#7883, containerd#7886, containerd#7891, containerd#7892, containerd#7893, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7959, containerd#7960, containerd#7963, containerd#7968, containerd#7969, containerd#7970, containerd#7973, containerd#7985, containerd#7987, containerd#7994, containerd#8005
This is a follow-up to address one item of this comment by @fuweid: #7679 (review)
The first commit fixes an issue running the tests (assert vs require, so the function result can be nil by mistake instead of failing early).
The second commit is the follow-up itself. I didn't use reflect, as it might be too slow to use on the container creation path. But this means we need to update sameUsernsConfig() if the runtime.UserNamespace type changes. Let me know if you prefer to use reflect here.
The third commit just removes a variable that is not really helpful. It is a cosmetic change, no functional change.