Unwrap error before comparing

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2022-06-28 16:27:03 +00:00
parent f52accc47f
commit 1f419d0abc

View file

@ -328,7 +328,7 @@ func (l *LXD) DeleteInstance(ctx context.Context, instance string) error {
// I am not proud of this, but the drivers.ErrInstanceIsStopped from LXD pulls in
// a ton of CGO, linux specific dependencies, that don't make sense having
// in garm.
if !(err.Error() == errInstanceIsStopped.Error()) {
if !(errors.Cause(err).Error() == errInstanceIsStopped.Error()) {
return errors.Wrap(err, "stopping instance")
}
}