csi: prevent in-use plugin GC from blocking volume GC (#9141)
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.
This commit is contained in:
parent
7eeb46fb5d
commit
8459f1ead5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue