Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the invalid ip #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions modules/agent/api/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ import (
"context"
"errors"
"fmt"
"net/http"
"runtime"
"sync/atomic"
"time"

"github.com/buger/jsonparser"
log "github.com/cihub/seelog"
"infini.sh/console/plugin/managed/server"
Expand All @@ -43,10 +48,6 @@ import (
"infini.sh/framework/modules/elastic/adapter"
"infini.sh/framework/modules/elastic/common"
"infini.sh/framework/modules/elastic/metadata"
"net/http"
"runtime"
"sync/atomic"
"time"
)

// node -> binding item
Expand Down Expand Up @@ -603,6 +604,11 @@ func (h *APIHandler) bindInstanceToCluster(clusterInfo ClusterInfo, nodes *elast
if util.ContainStr(ip, "::") {
ip = fmt.Sprintf("[%s]", ip)
}

if util.ContainStr(ip, "*") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the case for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i my case which agent erolled failed by the ip *

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

ip = "127.0.0.1"
}

nodeHost := fmt.Sprintf("%s:%d", ip, port)
nodeInfo := h.internalProcessBind(clusterID, clusterUUID, instanceID, instanceEndpoint, pid, nodeHost, auth)
if nodeInfo != nil {
Expand Down
Loading