1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

EE-2463 When add agent to k8s with AGENT_SECRET, AGENT_SECRET should be configured on both side. otherwise, it will get unknown error. this error should be "agent already paired with another Portainer instance" (#6679)

This commit is contained in:
Chao Geng 2022-04-01 14:40:44 +08:00 committed by GitHub
parent ee90fffce1
commit f59459f936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -470,7 +470,7 @@ func (handler *Handler) createTLSSecuredEndpoint(payload *endpointCreatePayload,
func (handler *Handler) snapshotAndPersistEndpoint(endpoint *portainer.Endpoint) *httperror.HandlerError {
err := handler.SnapshotService.SnapshotEndpoint(endpoint)
if err != nil {
if strings.Contains(err.Error(), "Invalid request signature") {
if strings.Contains(err.Error(), "Invalid request signature") || strings.Contains(err.Error(), "unknown") {
err = errors.New("agent already paired with another Portainer instance")
}
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to initiate communications with environment", err}