mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Fix unregistering agents used with agent tokens (#2870)
from discussion on matrix I'm not sure if this is the best way to fix this, but I don't really see a different way.
This commit is contained in:
parent
a6d651175d
commit
111a0b4ea5
1 changed files with 4 additions and 0 deletions
|
@ -352,6 +352,10 @@ func (s *RPC) RegisterAgent(ctx context.Context, platform, backend, version stri
|
|||
|
||||
func (s *RPC) UnregisterAgent(ctx context.Context) error {
|
||||
agent, err := s.getAgentFromContext(ctx)
|
||||
if agent.OwnerID > 0 {
|
||||
// registered with individual agent token -> do not unregister
|
||||
return nil
|
||||
}
|
||||
log.Debug().Msgf("unregistering agent with ID %d", agent.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue