Fix build tools image so make test in ztunnel can work without root#3207
Conversation
There were a few issues that prevented me from being able to successfully run `make test` in ztunnel code: 1. Cargo directories are owned by root, while the `make test` runs cargo as non root; there was an attempt to give cargo directories in the build tools image broad enough permissions, so that user does not matter anymore (see istio#249) but when cargo directories were added on top of that we should have applied chmod recursively for this to work; 2. /var/run/netns directory just does not exist in the container 3. AppArmor transfer process to a restricted profile when it creates a new user namespace and the restrictions breaks the test. This change addresses issues 1 and 2. To test that the change works I worked around the issue 3 by running this: ``` echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns ``` And once I did that, I was able to run `make test` in ztunnel repo successfully with the locally built build-tools image. Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
|
😊 Welcome @krinkinmu! This is either your first contribution to the Istio tools repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
The committers listed above are authorized under a signed CLA. |
|
Hi @krinkinmu. Thanks for your PR. I'm waiting for a istio 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-sigs/prow repository. |
|
/ok-to-test |
Here is some of the contributions to Istio project so far: * istio/tools#3207 * istio/ztunnel#1565 and istio/ztunnel#1555 Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
Here is some of the contributions to Istio project so far: * istio/tools#3207 * istio/ztunnel#1565 and istio/ztunnel#1555 Signed-off-by: Mikhail Krinkin <mkrinkin@microsoft.com>
There were a few issues that prevented me from being able to successfully run
make testin ztunnel code:make testruns cargo as non root; there was an attempt to give cargo directories in the build tools image broad enough permissions, so that user does not matter anymore (see Permissions on mount points need to be expanded #249) but when cargo directories were added on top of that we should have applied chmod recursively for this to work;This change addresses issues 1 and 2. To test that the change works I worked around the issue 3 by running this:
And once I did that, I was able to run
make testin ztunnel repo successfully with the locally built build-tools image.+cc @keithmattix @Stevenjin8 @jaellio