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)

pull/6637/head^2
Chao Geng 3 years ago committed by GitHub
parent ee90fffce1
commit f59459f936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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}

Loading…
Cancel
Save