Skip to content

Commit

Permalink
Merge pull request #23053 from mariushoch/main
Browse files Browse the repository at this point in the history
sqlite_state: Fix RewriteVolumeConfig
  • Loading branch information
openshift-merge-bot[bot] authored Jun 20, 2024
2 parents a2bf49a + 6dd9abf commit f6be78d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/sqlite_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
return fmt.Errorf("updating volume config table with new configuration for volume %s: %w", volume.Name(), err)
}
Expand Down
23 changes: 23 additions & 0 deletions test/system/760-system-renumber.bats
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f6be78d

Please sign in to comment.