Skip to content

Commit

Permalink
Merge pull request #103 from klihub/fixes/close-on-sync-failure
Browse files Browse the repository at this point in the history
adaptation: close plugin if initial synchronization fails.
  • Loading branch information
fuweid committed Aug 28, 2024
2 parents e1d8260 + 4aec208 commit 53760d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/adaptation/adaptation.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ func (r *Adaptation) acceptPluginConnections(l net.Listener) error {
r.plugins = append(r.plugins, p)
r.sortPlugins()
r.Unlock()
}

log.Infof(ctx, "plugin %q connected", p.name())
log.Infof(ctx, "plugin %q connected and synchronized", p.name())
}
}
}()

Expand Down
1 change: 1 addition & 0 deletions pkg/adaptation/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ func (p *plugin) synchronize(ctx context.Context, pods []*PodSandbox, containers
}
rpl, err := p.stub.Synchronize(ctx, req)
if err != nil {
p.close()
return nil, err
}

Expand Down

0 comments on commit 53760d4

Please sign in to comment.