Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Move info.proto et al to correct package #2193

Merged
merged 2 commits into from
Feb 7, 2020
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
56 changes: 28 additions & 28 deletions server/info/info.pb.go → pkg/apiclient/info/info.pb.go

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

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

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "server/info/info.proto",
"title": "pkg/apiclient/info/info.proto",
"version": "version not set"
},
"consumes": [
Expand Down
5 changes: 3 additions & 2 deletions server/apiserver/argoserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/argoproj/argo/errors"
"github.com/argoproj/argo/persist/sqldb"
cronworkflowpkg "github.com/argoproj/argo/pkg/apiclient/cronworkflow"
infopkg "github.com/argoproj/argo/pkg/apiclient/info"
workflowpkg "github.com/argoproj/argo/pkg/apiclient/workflow"
workflowarchivepkg "github.com/argoproj/argo/pkg/apiclient/workflowarchive"
workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate"
Expand Down Expand Up @@ -192,7 +193,7 @@ func (as *argoServer) newGRPCServer(offloadNodeStatusRepo sqldb.OffloadNodeStatu

grpcServer := grpc.NewServer(sOpts...)

info.RegisterInfoServiceServer(grpcServer, info.NewInfoServer(as.managedNamespace))
infopkg.RegisterInfoServiceServer(grpcServer, info.NewInfoServer(as.managedNamespace))
workflowpkg.RegisterWorkflowServiceServer(grpcServer, workflow.NewWorkflowServer(offloadNodeStatusRepo))
workflowtemplatepkg.RegisterWorkflowTemplateServiceServer(grpcServer, workflowtemplate.NewWorkflowTemplateServer())
cronworkflowpkg.RegisterCronWorkflowServiceServer(grpcServer, cronworkflow.NewCronWorkflowServer())
Expand Down Expand Up @@ -226,7 +227,7 @@ func (as *argoServer) newHTTPServer(ctx context.Context, port int, artifactServe
// we use our own Marshaler
gwMuxOpts := runtime.WithMarshalerOption(runtime.MIMEWildcard, new(json.JSONMarshaler))
gwmux := runtime.NewServeMux(gwMuxOpts)
mustRegisterGWHandler(info.RegisterInfoServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dialOpts)
mustRegisterGWHandler(infopkg.RegisterInfoServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dialOpts)
mustRegisterGWHandler(workflowpkg.RegisterWorkflowServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dialOpts)
mustRegisterGWHandler(workflowtemplatepkg.RegisterWorkflowTemplateServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dialOpts)
mustRegisterGWHandler(cronworkflowpkg.RegisterCronWorkflowServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dialOpts)
Expand Down
12 changes: 8 additions & 4 deletions server/info/info_server.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package info

import "context"
import (
"context"

infopkg "github.com/argoproj/argo/pkg/apiclient/info"
)

type infoServer struct {
managedNamespace string
}

func (i *infoServer) GetInfo(context.Context, *GetInfoRequest) (*InfoResponse, error) {
return &InfoResponse{ManagedNamespace: i.managedNamespace}, nil
func (i *infoServer) GetInfo(context.Context, *infopkg.GetInfoRequest) (*infopkg.InfoResponse, error) {
return &infopkg.InfoResponse{ManagedNamespace: i.managedNamespace}, nil
}

func NewInfoServer(managedNamespace string) InfoServiceServer {
func NewInfoServer(managedNamespace string) infopkg.InfoServiceServer {
return &infoServer{managedNamespace}
}