Skip to content

Commit

Permalink
deploy service-set changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-024 committed Jan 17, 2025
1 parent f67cf67 commit a665549
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
3 changes: 0 additions & 3 deletions cmd/deploy/service-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,15 @@ func executeDeployServiceSet(cmd *cobra.Command) {
conflictingServicesRequest := &serviceProto.GetConflictingServicesRequest{
EnvName: env,
Name: deployServiceSetRequest.Name,
// Add other necessary fields from deployServiceSetRequest if needed
}

services, errs := serviceClient.GetConflictingServices(&ctx, conflictingServicesRequest)
if errs != nil {
log.Fatal("Failed to list services with conflicting versions. ", errs)
return
}
//create empty array of strings
var serviceNames []string
for _, service := range services.Services {
//ask for confirmation if service is not in service set

allowedInputsSlice := []string{"y", "n"}
allowedInputs := make(map[string]struct{}, len(allowedInputsSlice))
Expand Down
2 changes: 1 addition & 1 deletion internal/service/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func grpcClient(ctx *context.Context) (*grpc.ClientConn, *context.Context, error
}

contextWithTrace := context.WithValue(*ctx, constant.TraceIDKey, traceID)
conn, err := grpc.Dial(appConfig.BackendAddress, opts...)
conn, err := grpc.NewClient(appConfig.BackendAddress, opts...)

if err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import (
"context"
"errors"
"fmt"
"io"

"github.com/briandowns/spinner"
"github.com/dream11/odin/pkg/constant"
"github.com/dream11/odin/pkg/util"
serviceDto "github.com/dream11/odin/proto/gen/go/dream11/od/dto/v1"
serviceProto "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1"
"github.com/olekukonko/tablewriter"
log "github.com/sirupsen/logrus"
"io"
)

// Service performs operation on service like deploy. undeploy
Expand Down
16 changes: 0 additions & 16 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,8 @@ func GenerateResponseMessage(response *v1.ServiceResponse) string {
// GenerateResponseMessage generate response message from ServiceSetResponse

Check failure on line 39 in pkg/util/util.go

View workflow job for this annotation

GitHub Actions / lint

comment on exported function GenerateServiceSetResponseMessage should be of the form "GenerateServiceSetResponseMessage ..." (ST1020)
func GenerateServiceSetResponseMessage(response *v1.DeployServiceSetServiceResponse) string {

/*message := fmt.Sprintf("\n Service %s %s %s %s", response.ServiceIdentifier.ServiceName, response.ServiceIdentifier.ServiceVersion, response.ServiceResponse.ServiceStatus.ServiceAction, response.ServiceResponse.ServiceStatus)
for _, compMessage := range response.ServiceResponse.ComponentsStatus {
message += fmt.Sprintf("\n Component %s %s %s %s", compMessage.ComponentName, compMessage.ComponentAction, compMessage.ComponentStatus, compMessage.Error)
}
return message*/

message := fmt.Sprintf("\n Service %s %s %s %s", response.ServiceIdentifier.ServiceName, response.ServiceIdentifier.ServiceVersion, response.ServiceResponse.ServiceStatus.ServiceAction, response.ServiceResponse.ServiceStatus)
var tableData [][]string

/*for _, compMessage := range response.ServiceIdentifier {
row := []string{
compMessage.ComponentName,
compMessage.ComponentAction,
compMessage.ComponentStatus,
compMessage.Error,
}
tableData = append(tableData, row)
}*/
row := []string{
response.ServiceIdentifier.ServiceName,
response.ServiceIdentifier.ServiceVersion,
Expand Down

0 comments on commit a665549

Please sign in to comment.