Skip to content
Merged
Show file tree
Hide file tree
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: 7 additions & 7 deletions api/mesh/v1alpha1/condition_route_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import (
"github.com/pkg/errors"
"sigs.k8s.io/yaml"

"github.com/apache/dubbo-admin/pkg/common/constants"
"github.com/apache/dubbo-admin/pkg/common/util/proto"
"github.com/apache/dubbo-admin/pkg/core/consts"
)

func (x *ConditionRoute) GetVersion() string {
if x.ToConditionRouteV3() != nil {
return consts.ConfiguratorVersionV3
return constants.ConfiguratorVersionV3
} else {
return consts.ConfiguratorVersionV3x1
return constants.ConfiguratorVersionV3x1
}
}

Expand All @@ -51,17 +51,17 @@ func ConditionRouteDecodeFromYAML(content []byte) (*ConditionRoute, error) {
return nil, err
}

version, ok := _map[consts.ConfigVersionKey].(string)
version, ok := _map[constants.ConfigVersionKey].(string)
if !ok {
return nil, errors.New("invalid condition route format")
}
if version == consts.ConfiguratorVersionV3 {
if version == constants.ConfiguratorVersionV3 {
v3 := new(ConditionRouteV3)
if err = proto.FromYAML(content, v3); err != nil {
return nil, err
}
return v3.ToConditionRoute(), nil
} else if version == consts.ConfiguratorVersionV3x1 {
} else if version == constants.ConfiguratorVersionV3x1 {
v3x1 := new(ConditionRouteV3X1)
if err = proto.FromYAML(content, v3x1); err != nil {
return nil, err
Expand Down Expand Up @@ -133,7 +133,7 @@ func (x *ConditionRule) IsMatchMethod() (string, bool) {
conditions := strings.Split(x.From.Match, "&")
for _, condition := range conditions {
if idx := strings.Index(condition, "method"); idx != -1 {
args := strings.Split(condition, consts.Equal)
args := strings.Split(condition, constants.Equal)
if len(args) == 2 {
return strings.TrimSpace(args[1]), true
}
Expand Down
1 change: 0 additions & 1 deletion api/mesh/v1alpha1/dynamic_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ message DynamicConfig {
option (dubbo.mesh.resource).plural_name = "DynamicConfigs";
option (dubbo.mesh.resource).package = "mesh";
option (dubbo.mesh.resource).is_experimental = false;

string key = 1;
string scope = 2;
string configVersion = 3;
Expand Down
4 changes: 2 additions & 2 deletions api/mesh/v1alpha1/dynamic_config_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ package v1alpha1
import (
"strings"

"github.com/apache/dubbo-admin/pkg/core/consts"
"github.com/apache/dubbo-admin/pkg/common/constants"
)

func GetOverridePath(key string) string {
key = strings.Replace(key, "/", "*", -1)
return key + consts.ConfiguratorRuleSuffix
return key + constants.ConfiguratorRuleSuffix
}

func (d *DynamicConfig) ListUnGenConfigs() []*OverrideConfig {
Expand Down
163 changes: 87 additions & 76 deletions api/mesh/v1alpha1/instance.pb.go

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions api/mesh/v1alpha1/instance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ message Instance {

string name = 1;

string ip = 2;
string appName = 2;

string ip = 3;

int64 rpcPort = 4;
/*
FROM RPCInstance
*/

int32 rpcPort = 3;

int32 qosPort = 4;

string appName = 5;
int64 qosPort = 5;

string releaseVersion = 6;

Expand All @@ -38,9 +37,11 @@ message Instance {

string serialization = 10;

string preferSerialization = 11;

map<string, string> tags = 50;

reserved 11 to 49;
reserved 12 to 49;

/*
FROM RuntimeInstance
Expand Down
146 changes: 146 additions & 0 deletions api/mesh/v1alpha1/nacos_config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions api/mesh/v1alpha1/nacos_config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package dubbo.mesh.v1alpha1;

option go_package = "github.com/apache/dubbo-admin/api/mesh/v1alpha1";

import "api/mesh/options.proto";

// Nacos config is the raw data of nacos configuration
message NacosConfig {
option (dubbo.mesh.resource).name = "NacosConfig";
option (dubbo.mesh.resource).plural_name = "NacosConfigs";
option (dubbo.mesh.resource).package = "mesh";
option (dubbo.mesh.resource).is_experimental = true;

string dataId = 1;

string content = 2;
}
Loading
Loading