Skip to content

Commit

Permalink
Add gateway flag to yorkie-cluster chart
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Oct 16, 2024
1 parent e1782a3 commit d97f668
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/yorkie/v1/system.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 The Yorkie Authors. All rights reserved.
* Copyright 2024 The Yorkie Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,4 +35,4 @@ message SystemServiceDetachDocumentRequest {
string document_key = 4;
}

message SystemServiceDetachDocumentResponse {}
message SystemServiceDetachDocumentResponse {}
2 changes: 2 additions & 0 deletions build/charts/yorkie-cluster/templates/yorkie/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
"{{ .Values.yorkie.ports.rpcPort }}",
"--profiling-port",
"{{ .Values.yorkie.ports.profilingPort }}",
"--backend-gateway-addr",
"{{ .Values.yorkie.gateway }}.{{ .Values.yorkie.namespace }}.svc.cluster.local",
]
ports:
- containerPort: {{ .Values.yorkie.ports.rpcPort }}
Expand Down
2 changes: 2 additions & 0 deletions build/charts/yorkie-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ yorkie:
name: yorkie
namespace: yorkie

gateway: yorkie-gateway

autoscaling:
enabled: false
replicaCount: 3
Expand Down
12 changes: 6 additions & 6 deletions server/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

// Package clients provides the Client related business logic.
// Package clients provides the client related business logic.
package clients

import (
Expand All @@ -29,13 +29,13 @@ import (

var (
// ErrInvalidClientKey is returned when the given Key is not valid ClientKey.
ErrInvalidClientKey = errors.New("invalid Client key")
ErrInvalidClientKey = errors.New("invalid client key")

// ErrInvalidClientID is returned when the given Key is not valid ClientID.
ErrInvalidClientID = errors.New("invalid Client id")
ErrInvalidClientID = errors.New("invalid client id")
)

// Activate activates the given Client.
// Activate activates the given client.
func Activate(
ctx context.Context,
db database.Database,
Expand All @@ -45,7 +45,7 @@ func Activate(
return db.ActivateClient(ctx, project.ID, clientKey)
}

// Deactivate deactivates the given Client.
// Deactivate deactivates the given client.
func Deactivate(
ctx context.Context,
be *backend.Backend,
Expand Down Expand Up @@ -95,7 +95,7 @@ func Deactivate(
return info, err
}

// FindActiveClientInfo find the active Client info by the given ref key.
// FindActiveClientInfo find the active client info by the given ref key.
func FindActiveClientInfo(
ctx context.Context,
db database.Database,
Expand Down
1 change: 1 addition & 0 deletions test/complex/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func TestMain(m *testing.M) {
ProjectInfoCacheSize: helper.ProjectInfoCacheSize,
ProjectInfoCacheTTL: helper.ProjectInfoCacheTTL.String(),
AdminTokenDuration: helper.AdminTokenDuration,
GatewayAddr: fmt.Sprintf("localhost:%d", helper.RPCPort),
}, &mongo.Config{
ConnectionURI: helper.MongoConnectionURI,
YorkieDatabase: shardedDBNameForServer,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/housekeeping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestHousekeeping(t *testing.T) {
log.Fatal(err)
}

_, err := be.DB.ActivateClient(ctx, projects[0].ID, fmt.Sprintf("%s-C", t.Name()))
_, err = be.DB.ActivateClient(ctx, projects[0].ID, fmt.Sprintf("%s-C", t.Name()))
assert.NoError(t, err)

_, candidates, err := clients.FindDeactivateCandidates(
Expand Down

0 comments on commit d97f668

Please sign in to comment.