Skip to content

Commit

Permalink
remove bootstrap check
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Dec 26, 2019
1 parent db94a10 commit d7603f7
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions server/config_manager/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ func (c *ConfigManager) Create(ctx context.Context, request *configpb.CreateRequ
return nil, err
}

cluster := c.svr.GetRaftCluster()
if cluster == nil {
return &configpb.CreateResponse{Header: c.componentHeader(), Status: &configpb.Status{
Code: configpb.StatusCode_UNKNOWN,
Message: "cluster is not bootstrapped",
}}, nil
}

version, config, status := c.CreateConfig(request.GetVersion(), request.GetComponent(), request.GetComponentId(), request.GetConfig())
if status.GetCode() == configpb.StatusCode_OK {
c.Persist(c.svr.GetStorage())
Expand All @@ -57,14 +49,6 @@ func (c *ConfigManager) Get(ctx context.Context, request *configpb.GetRequest) (
return nil, err
}

cluster := c.svr.GetRaftCluster()
if cluster == nil {
return &configpb.GetResponse{Header: c.componentHeader(), Status: &configpb.Status{
Code: configpb.StatusCode_UNKNOWN,
Message: "cluster is not bootstrapped",
}}, nil
}

version, config, status := c.GetConfig(request.GetVersion(), request.GetComponent(), request.GetComponentId())

return &configpb.GetResponse{
Expand All @@ -81,14 +65,6 @@ func (c *ConfigManager) Update(ctx context.Context, request *configpb.UpdateRequ
return nil, err
}

cluster := c.svr.GetRaftCluster()
if cluster == nil {
return &configpb.UpdateResponse{Header: &configpb.Header{ClusterId: c.svr.ClusterID()}, Status: &configpb.Status{
Code: configpb.StatusCode_UNKNOWN,
Message: "cluster is not bootstrapped",
}}, nil
}

version, status := c.UpdateConfig(request.GetKind(), request.GetVersion(), request.GetEntries())
if status.GetCode() == configpb.StatusCode_OK {
c.Persist(c.svr.GetStorage())
Expand All @@ -107,13 +83,6 @@ func (c *ConfigManager) Delete(ctx context.Context, request *configpb.DeleteRequ
return nil, err
}

cluster := c.svr.GetRaftCluster()
if cluster == nil {
return &configpb.DeleteResponse{Header: &configpb.Header{ClusterId: c.svr.ClusterID()}, Status: &configpb.Status{
Code: configpb.StatusCode_UNKNOWN,
Message: "cluster is not bootstrapped",
}}, nil
}
status := c.DeleteConfig(request.GetKind(), request.GetVersion())
if status.GetCode() == configpb.StatusCode_OK {
c.Persist(c.svr.GetStorage())
Expand Down

0 comments on commit d7603f7

Please sign in to comment.