Skip to content

Commit

Permalink
csi: prevent in-use plugin GC from blocking volume GC (#9141)
Browse files Browse the repository at this point in the history
During CSI plugin GC, we don't return an error if the volume is in use,
because this is not an error condition. If we were to return an error during a
`nomad system gc`, we would not continue on to GC volumes.

But check for the specific error message fails if the GC is performed on a
worker rather than on the leader, due to RPC forwarding wrapping the error
message. Use a less specific test so that we don't return an error.
  • Loading branch information
tgross committed Oct 21, 2020
1 parent 8c7ccb2 commit fc1b0c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nomad/core_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ func (c *CoreScheduler) csiPluginGC(eval *structs.Evaluation) error {
}}
err := c.srv.RPC("CSIPlugin.Delete", req, &structs.CSIPluginDeleteResponse{})
if err != nil {
if err.Error() == "plugin in use" {
if strings.Contains(err.Error(), "plugin in use") {
continue
}
c.logger.Error("failed to GC plugin", "plugin_id", plugin.ID, "error", err)
Expand Down

0 comments on commit fc1b0c1

Please sign in to comment.