mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
Same mechanical rename as on master, applied to the v3.4.5 release lineage, which is the code production actually runs. Targets were re-enumerated against this tree rather than reused from master. This branch exists so the first Hanzo CD image is a like-for-like cutover: identical argo-cd code, published from our registry by our CI. Master is a different lineage — VERSION 3.6.0, 823 commits ahead of v3.4.5 and missing 98 of its backports — so an image built there would change the code as well as the registry. Moving the lineage is its own change, gated separately. go build ./cmd/... passes before and after the rename.
39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package commitserver
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/health"
|
|
"google.golang.org/grpc/health/grpc_health_v1"
|
|
|
|
"github.com/hanzoai/deploy/v3/commitserver/apiclient"
|
|
"github.com/hanzoai/deploy/v3/commitserver/commit"
|
|
"github.com/hanzoai/deploy/v3/commitserver/metrics"
|
|
versionpkg "github.com/hanzoai/deploy/v3/pkg/apiclient/version"
|
|
"github.com/hanzoai/deploy/v3/server/version"
|
|
"github.com/hanzoai/deploy/v3/util/git"
|
|
)
|
|
|
|
// ArgoCDCommitServer is the server that handles commit requests.
|
|
type ArgoCDCommitServer struct {
|
|
commitService *commit.Service
|
|
}
|
|
|
|
// NewServer returns a new instance of the commit server.
|
|
func NewServer(gitCredsStore git.CredsStore, metricsServer *metrics.Server) *ArgoCDCommitServer {
|
|
return &ArgoCDCommitServer{commitService: commit.NewService(gitCredsStore, metricsServer)}
|
|
}
|
|
|
|
// CreateGRPC creates a new gRPC server.
|
|
func (a *ArgoCDCommitServer) CreateGRPC() *grpc.Server {
|
|
server := grpc.NewServer(grpc.MaxRecvMsgSize(apiclient.MaxGRPCMessageSize))
|
|
versionpkg.RegisterVersionServiceServer(server, version.NewServer(nil, func() (bool, error) {
|
|
return true, nil
|
|
}))
|
|
apiclient.RegisterCommitServiceServer(server, a.commitService)
|
|
|
|
healthService := health.NewServer()
|
|
grpc_health_v1.RegisterHealthServer(server, healthService)
|
|
|
|
return server
|
|
}
|