Skip to content

Commit

Permalink
Merge pull request #2542 from openziti/add-cluster-id
Browse files Browse the repository at this point in the history
Add cluster id, to prevent merging disparate clusters. Fixes #2541
  • Loading branch information
plorenz authored Nov 15, 2024
2 parents e6d2fdc + c2162ea commit 4c9c647
Show file tree
Hide file tree
Showing 30 changed files with 705 additions and 721 deletions.
372 changes: 220 additions & 152 deletions common/pb/cmd_pb/cmd.pb.go

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions common/pb/cmd_pb/cmd.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum CommandType {
DeleteTerminatorsBatchType = 4;

SyncSnapshot = 10;
InitClusterId = 11;
}

message ChangeContext {
Expand Down Expand Up @@ -76,6 +77,10 @@ message SyncSnapshotCommand {
bytes snapshot = 2;
}

message InitClusterIdCommand {
string clusterId = 1;
}

message DeleteTerminatorsBatchCommand {
repeated string entityIds = 1;
ChangeContext ctx = 2;
Expand Down
4 changes: 4 additions & 0 deletions common/pb/cmd_pb/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func (x *SyncSnapshotCommand) GetCommandType() int32 {
return int32(CommandType_SyncSnapshot)
}

func (x *InitClusterIdCommand) GetCommandType() int32 {
return int32(CommandType_InitClusterId)
}

func EncodeTags(tags map[string]interface{}) (map[string]*TagValue, error) {
if len(tags) == 0 {
return nil, nil
Expand Down
27 changes: 0 additions & 27 deletions common/pb/ctrl_pb/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package ctrl_pb

import (
"github.com/openziti/channel/v3/protobufs"
"github.com/openziti/ziti/controller/xt"
)

Expand Down Expand Up @@ -110,29 +109,3 @@ func (request *UpdateCtrlAddresses) GetContentType() int32 {
func (request *PeerStateChanges) GetContentType() int32 {
return int32(ContentType_PeerStateChangeRequestType)
}

type FilterableValidateTerminatorsRequest interface {
protobufs.TypedMessage
FilterTerminators(f func(terminator *Terminator) bool)
GetTerminators() []*Terminator
}

func (request *ValidateTerminatorsRequest) FilterTerminators(f func(terminator *Terminator) bool) {
var terminators []*Terminator
for _, terminator := range request.Terminators {
if f(terminator) {
terminators = append(terminators, terminator)
}
}
request.Terminators = terminators
}

func (request *ValidateTerminatorsV2Request) FilterTerminators(f func(terminator *Terminator) bool) {
var terminators []*Terminator
for _, terminator := range request.Terminators {
if f(terminator) {
terminators = append(terminators, terminator)
}
}
request.Terminators = terminators
}
216 changes: 0 additions & 216 deletions common/pb/edge_mgmt_pb/edge_mgmt.pb.go

This file was deleted.

15 changes: 0 additions & 15 deletions common/pb/edge_mgmt_pb/edge_mgmt.proto

This file was deleted.

5 changes: 0 additions & 5 deletions common/pb/edge_mgmt_pb/generate.go

This file was deleted.

5 changes: 0 additions & 5 deletions common/pb/edge_mgmt_pb/impl.go

This file was deleted.

4 changes: 4 additions & 0 deletions common/pb/mgmt_pb/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ func (request *ValidateIdentityConnectionStatusesResponse) GetContentType() int3
func (request *RouterIdentityConnectionStatusesDetails) GetContentType() int32 {
return int32(ContentType_ValidateIdentityConnectionStatusesResultType)
}

func (x *InitRequest) GetContentType() int32 {
return int32(ContentType_RaftInit)
}
Loading

0 comments on commit 4c9c647

Please sign in to comment.