-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix/service set update #272
base: 2.x.x
Are you sure you want to change the base?
Conversation
string service_version = 2; | ||
string name = 1; | ||
string version = 2; | ||
string tags = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tags is a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this binary
tableData = append(tableData, row) | ||
|
||
table := tablewriter.NewWriter(os.Stdout) | ||
table.SetHeader([]string{"Service Name", "Service Version", "Service Action", "Service Status", "Error"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table.SetHeader([]string{"Service Name", "Service Version", "Service Action", "Service Status", "Error"}) | |
table.SetHeader([]string{"Service Name", "Version", "Action", "Status", "Error"}) |
spinnerInstance.Stop() | ||
var buf bytes.Buffer | ||
table := tablewriter.NewWriter(&buf) | ||
table.SetHeader([]string{"Service Name", "Service Version", "Service Tags", "Service Action", "Service Status", "Error"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table.SetHeader([]string{"Service Name", "Service Version", "Service Tags", "Service Action", "Service Status", "Error"}) | |
table.SetHeader([]string{"Service Name", "Version", "Tags", "Action", "Status", "Error"}) |
@@ -63,6 +65,7 @@ func (e *Service) DeployService(ctx *context.Context, request *serviceProto.Depl | |||
func (e *Service) DeployServiceSet(ctx *context.Context, request *serviceProto.DeployServiceSetRequest) error { | |||
conn, requestCtx, err := grpcClient(ctx) | |||
if err != nil { | |||
log.Errorf("TraceID: %s", (*requestCtx).Value(constant.TraceIDKey)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is error log?
var serviceNames []string | ||
for _, service := range services.Services { | ||
|
||
allowedInputsSlice := []string{"y", "n"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use constants for "y" or "n"
for _, input := range allowedInputsSlice { | ||
allowedInputs[input] = struct{}{} | ||
} | ||
message := "Service already deployed with different version.Do you want to deploy service " + service.Name + " ? (y/n)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use string formatter
resolve conflicts |
|
||
services, errs := serviceClient.GetConflictingServices(&ctx, conflictingServicesRequest) | ||
if errs != nil { | ||
log.Fatal("Failed to list services with conflicting versions. ", errs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the err
object printed?
val, err := inputHandler.AskWithConstraints(message, allowedInputs) | ||
|
||
if err != nil { | ||
log.Fatal(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some error message here
} | ||
|
||
if val != "y" { | ||
log.Info("Skipping service ", service.Name, " from deploy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use formatted strings
err := serviceClient.DeployServiceSet(&ctx, &deployServiceSetRequest) | ||
if err != nil { | ||
log.Fatal("Failed to deploy service ", err) | ||
log.Fatal("Failed to deploy service set. ", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this err objected logged?
log.Info("Skipping service ", service.Name, " from deploy") | ||
serviceNames = append(serviceNames, service.Name) | ||
} | ||
// Remove services from deployServiceSetRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this logic be part of the client? Do you think this should be handled by the deployer?
spinnerInstance.Prefix = fmt.Sprintf(" %s ", message) | ||
spinnerInstance.Start() | ||
} | ||
} | ||
|
||
log.Info(message) | ||
fmt.Println(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changed this?
client := serviceProto.NewServiceServiceClient(conn) | ||
response, err := client.GetConflictingServices(*requestCtx, request) | ||
if err != nil { | ||
log.Errorf("TraceID: %s", (*requestCtx).Value(constant.TraceIDKey)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an error log?
Odin version(x.y.z)
Features
Resources