mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #23053 from mariushoch/main
sqlite_state: Fix RewriteVolumeConfig
This commit is contained in:
@ -1310,7 +1310,7 @@ func (s *SQLiteState) RewriteVolumeConfig(volume *Volume, newCfg *VolumeConfig)
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
results, err := tx.Exec("UPDATE VolumeConfig SET Name=?, JSON=? WHERE ID=?;", newCfg.Name, json, volume.Name())
|
results, err := tx.Exec("UPDATE VolumeConfig SET Name=?, JSON=? WHERE Name=?;", newCfg.Name, json, volume.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("updating volume config table with new configuration for volume %s: %w", volume.Name(), err)
|
return fmt.Errorf("updating volume config table with new configuration for volume %s: %w", volume.Name(), err)
|
||||||
}
|
}
|
||||||
|
23
test/system/760-system-renumber.bats
Normal file
23
test/system/760-system-renumber.bats
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bats -*- bats -*-
|
||||||
|
#
|
||||||
|
# tests for podman system renumber
|
||||||
|
#
|
||||||
|
|
||||||
|
load helpers
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
basic_setup
|
||||||
|
|
||||||
|
skip_if_remote "podman system renumber is not available remote"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "podman system renumber - Basic test with a volume" {
|
||||||
|
run_podman volume create test
|
||||||
|
assert "$output" == "test" "podman volume create output"
|
||||||
|
run_podman system renumber
|
||||||
|
assert "$output" == "" "podman system renumber output"
|
||||||
|
run_podman volume rm test
|
||||||
|
assert "$output" == "test" "podman volume rm output"
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim: filetype=sh
|
Reference in New Issue
Block a user