Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1579 from openziti/add-logging-on-bind-conflict
Browse files Browse the repository at this point in the history
Add some warn logging on terminator instance id bind conflict
  • Loading branch information
plorenz authored Aug 9, 2023
2 parents 04a5f7a + 6426d55 commit 9eeddc6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion controller/model/create_terminator_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/openziti/fabric/pb/cmd_pb"
"github.com/openziti/storage/boltz"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"go.etcd.io/bbolt"
"strings"
)
Expand Down Expand Up @@ -54,7 +55,14 @@ func (self *CreateEdgeTerminatorCmd) validateTerminatorIdentity(ctx boltz.Mutate
}
if otherSession != nil {
if otherSession.ApiSession.IdentityId != session.ApiSession.IdentityId {
return errors.Errorf("sibling terminator %v with shared identity %v belongs to different identity", terminator.GetId(), terminator.GetInstanceId())
pfxlog.Logger().WithFields(logrus.Fields{
"terminatorId": terminator.GetId(),
"siblingId": otherTerminator.GetId(),
"instanceId": terminator.InstanceId,
"terminatorIdentity": session.ApiSession.IdentityId,
"existingIdentity": otherSession.ApiSession.IdentityId,
}).Warn("validation of terminator failed, shared identity belongs to different identity")
return errors.Errorf("sibling terminator %v with shared identity %v belongs to different identity", otherTerminator.GetId(), terminator.GetInstanceId())
}
}
}
Expand Down

0 comments on commit 9eeddc6

Please sign in to comment.