Skip to content

Commit

Permalink
fix:修复sidecar无法获取到xds规则 (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Apr 7, 2023
1 parent cdb45a8 commit f292126
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apiserver/xdsserverv3/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (PolarisNodeHash) ID(node *core.Node) string {

runType, ns, _, _ := parseNodeID(node.Id)
if runType == string(RunTypeSidecar) {
ret := runType + sep + ns
ret := ns
if node.Metadata != nil && node.Metadata.Fields != nil {
tlsMode := node.Metadata.Fields[TLSModeTag].GetStringValue()
if tlsMode == TLSModePermissive || tlsMode == TLSModeStrict {
Expand Down
10 changes: 8 additions & 2 deletions common/model/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (r *ExtendRouterConfig) ToApi() (*apitraffic.RouteRule, error) {
}
}

return &apitraffic.RouteRule{
rule := &apitraffic.RouteRule{
Id: r.ID,
Name: r.Name,
Namespace: r.Namespace,
Expand All @@ -104,7 +104,13 @@ func (r *ExtendRouterConfig) ToApi() (*apitraffic.RouteRule, error) {
Etime: commontime.Time2String(r.EnableTime),
Priority: r.Priority,
Description: r.Description,
}, nil
}
if r.EnableTime.Year() > 2000 {
rule.Etime = commontime.Time2String(r.EnableTime)
} else {
rule.Etime = ""
}
return rule, nil
}

// RouterConfig Routing rules
Expand Down

0 comments on commit f292126

Please sign in to comment.