mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-09-30 02:17:08 +02:00
update devcontainer image, enhance contributing guide, and implement mutex for PCS commands
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
{
|
||||
"name": "democratic-csi",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
|
||||
// regarding versioning the first number is the devcontainer image version,
|
||||
// the second is the Node.js version, and the third is the OS version.
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node:4-20-bookworm",
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
|
||||
@@ -62,6 +62,10 @@ cd ~/democratic-csi
|
||||
./hack/run.sh -c ./hack/config.yaml
|
||||
```
|
||||
|
||||
>![Note]
|
||||
> For running tests with democratic-csi the authentication needs to be disabled, as
|
||||
> it always initiates connections to the share without authentication.
|
||||
|
||||
##### Keeping Files in Sync
|
||||
|
||||
Use these methods to keep your local files synchronized with the Vagrant VM:
|
||||
|
||||
Vendored
+3
@@ -18,6 +18,9 @@ Vagrant.configure("2") do |config|
|
||||
end
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
# force version 20.x of nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
|
||||
sudo apt-get update -y
|
||||
|
||||
# for building dependecies and executing node
|
||||
|
||||
@@ -20,6 +20,7 @@ class ControllerZfsGenericDriver extends ControllerZfsBaseDriver {
|
||||
this.targetCliMutex = new Mutex();
|
||||
this.nvmetCliMutex = new Mutex();
|
||||
this.spdkCliMutex = new Mutex();
|
||||
this.pcsMutex = new Mutex();
|
||||
}
|
||||
|
||||
getExecClient() {
|
||||
@@ -1000,24 +1001,27 @@ save_config filename=${this.options.nvmeof.shareStrategySpdkCli.configPath}
|
||||
let options = {
|
||||
pty: true,
|
||||
};
|
||||
let response = await execClient.exec(
|
||||
execClient.buildCommand(command, args),
|
||||
options
|
||||
);
|
||||
driver.ctx.logger.verbose(
|
||||
"pcs response: " + JSON.stringify(response)
|
||||
);
|
||||
|
||||
// Handle idempotence for create commands
|
||||
if (response.code == 1 && response.stdout.includes("already exists")) {
|
||||
driver.ctx.logger.verbose("pcs resource already exists, ignoring error (setting response.code=0)");
|
||||
response.code = 0;
|
||||
}
|
||||
|
||||
if (response.code != 0) {
|
||||
throw response;
|
||||
}
|
||||
return response;
|
||||
return driver.pcsMutex.runExclusive(async () => {
|
||||
let response = await execClient.exec(
|
||||
execClient.buildCommand(command, args),
|
||||
options
|
||||
);
|
||||
driver.ctx.logger.verbose(
|
||||
"pcs response: " + JSON.stringify(response)
|
||||
);
|
||||
|
||||
// Handle idempotence for create commands
|
||||
if (response.code == 1 && response.stdout.includes("already exists")) {
|
||||
driver.ctx.logger.verbose("pcs resource already exists, ignoring error (setting response.code=0)");
|
||||
response.code = 0;
|
||||
}
|
||||
|
||||
if (response.code != 0) {
|
||||
throw response;
|
||||
}
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
||||
async targetCliCommand(data) {
|
||||
|
||||
Reference in New Issue
Block a user