Skip to content

Commit

Permalink
Merge pull request #10311 from dmcgowan/1.7-backport-fail-integration…
Browse files Browse the repository at this point in the history
…-plugins
  • Loading branch information
fuweid committed Jun 13, 2024
2 parents e9d70a5 + 884094b commit 727c392
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions integration/client/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ import (
"io"
"os/exec"
"runtime"
"strings"
"sync"
"syscall"
"time"

. "github.com/containerd/containerd"
"github.com/containerd/containerd/plugin"
)

type daemon struct {
Expand Down Expand Up @@ -79,6 +81,21 @@ func (d *daemon) waitForStart(ctx context.Context) (*Client, error) {
}
continue
}
resp, perr := client.IntrospectionService().Plugins(ctx, nil)
if perr != nil {
return nil, fmt.Errorf("failed to get plugin list: %w", perr)
}
var loadErr error
for _, p := range resp.Plugins {
if p.InitErr != nil && !strings.Contains(p.InitErr.Message, plugin.ErrSkipPlugin.Error()) {
pluginErr := fmt.Errorf("failed to load %s.%s: %s", p.Type, p.ID, p.InitErr.Message)
loadErr = errors.Join(loadErr, pluginErr)
}
}
if loadErr != nil {
return nil, loadErr
}

return client, err
case <-ctx.Done():
return nil, fmt.Errorf("context deadline exceeded: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion snapshots/devmapper/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package plugin

import (
"errors"
"fmt"

"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/snapshots/devmapper"
Expand All @@ -40,7 +41,7 @@ func init() {
}

if config.PoolName == "" {
return nil, errors.New("devmapper not configured")
return nil, fmt.Errorf("devmapper not configured: %w", plugin.ErrSkipPlugin)
}

if config.RootPath == "" {
Expand Down

0 comments on commit 727c392

Please sign in to comment.