Give the manager a writable /tmp for seed ISOs; keep the libvirt connection on classified errors
The manager runs with a read-only root filesystem and the seed ISO writer stages files in a temp directory, so the first in-cluster Create failed with "creating iso writer: read-only file system". Mount a 64 MiB emptyDir on /tmp. That error is classified ErrPermanent by writeSeed, yet hostPool.call treated every non-libvirt error as a transport failure and dropped the cached SSH connection, redialling on each retry. Errors that already carry a provider sentinel are local verdicts, not evidence about the link; leave the connection alone for those. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,18 @@ func isLibvirtError(err error) bool {
|
||||
return errors.As(err, &lerr)
|
||||
}
|
||||
|
||||
// isClassified reports whether err already carries one of the provider's
|
||||
// sentinels, i.e. the package reached a verdict itself rather than hitting
|
||||
// a transport failure.
|
||||
func isClassified(err error) bool {
|
||||
for _, class := range []error{provider.ErrNotFound, provider.ErrQuotaExceeded, provider.ErrPermanent, provider.ErrTransient} {
|
||||
if errors.Is(err, class) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func hasCode(err error, code libvirt.ErrorNumber) bool {
|
||||
var lerr libvirt.Error
|
||||
return errors.As(err, &lerr) && libvirt.ErrorNumber(lerr.Code) == code
|
||||
|
||||
Reference in New Issue
Block a user