-
Notifications
You must be signed in to change notification settings - Fork 314
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
io.etcd.jetcd.launcher.EtcdContainer -- Error deleting directory when using jetcd-tests on unit-testing. #1310
Comments
if (shouldMountDataDirectory) {
dataDirectory = createDataDirectory(node);
addFileSystemBind(dataDirectory.toString(), Etcd.ETCD_DATA_DIR, BindMode.READ_WRITE, SelinuxContext.SHARED);
}
@RegisterExtension
public static final EtcdClusterExtension CLUSTER = EtcdClusterExtension.builder()
.withNodes(1)
.withMountDirectory(false)
.build();
|
This is something that has nothing to do with the requirement of the container image but it is something implemented for our test suite which for some tests requires to manipulate the content of the data dir.
Before changing the behavior, you need to check what the current test suite is doing. In any case, this does not solve the issue but just hide it so it would be nice to find out if there is a way to make it working regardless of the flag. |
|
As stated in the previous comment, I do not have any issue to change it but:
Can you help us on that ? |
|
So I guess you can:
|
|
I think this is an issue with your linux distro/WSL because on my linux computer, where I'm not root, this is what I get in my
|
Again, I can change it to default but I need some help understanding the impact on the actual test suite of jetcd. |
linghengqian@DESKTOP-2OCN434:/tmp$ ls -la
总计 76
drwxr-xr-x 3 linghengqian linghengqian 4096 8月 7 22:31 jetcd_test_etcd0_15814517176251913946
drwxr-xr-x 3 linghengqian linghengqian 4096 8月 7 22:04 jetcd_test_etcd0_6561556027985872395
linghengqian@DESKTOP-2OCN434:/tmp/jetcd_test_etcd0_15814517176251913946$ ls -la
总计 40
drwxr-xr-x 3 linghengqian linghengqian 4096 8月 7 22:31 .
drwxrwxrwt 13 root root 28672 8月 7 22:40 ..
drwx------ 4 root root 4096 8月 7 22:31 member |
Not on my system:
|
since those files are created by the etcd container, then it may be the docker setup. |
sudo apt update && sudo apt upgrade -y
sudo apt-get remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc
cd /tmp/
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
|
maybe it could be possible to configure the user the container runs as when starting the etcd container but I don't have any experience on WSL nor a computer to test. I would appreciate if you can investigate more and I'd be happy to review a patch. |
|
Hi @linghengqian! No, I'm not running docker in rootless mode. |
|
|
|
For #1310 Signed-off-by: linghengqian <linghengqian@outlook.com>
@RegisterExtension
public static final EtcdClusterExtension CLUSTER = EtcdClusterExtension.builder()
.withNodes(1)
.build();
@RegisterExtension
public static final EtcdClusterExtension CLUSTER = EtcdClusterExtension.builder()
.withNodes(1)
.withUser("1000:1000")
.build();
@RegisterExtension
public static final EtcdClusterExtension CLUSTER = EtcdClusterExtension.builder()
.withNodes(1)
.withMountDirectory(false)
.build();
|
Please open a dedicated issue |
|
Fixed by #1390 |
Versions
Describe the bug
At the end of unit tests when using jetcd-tests, an error
io.etcd.jetcd.launcher.EtcdContainer -- Error deleting directory
is thrown. It doesn't prevent the test to run successfully, but I wonder if it's something wrong I'm doing.To Reproduce
Unit test logs:
Expected behavior
It is expected that this AccessDeniedException don't appear at all.
Additional context
The text was updated successfully, but these errors were encountered: