mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
Improve CLI sync messages
This commit is contained in:
parent
a369d51a27
commit
155f608761
2 changed files with 7 additions and 3 deletions
|
|
@ -132,9 +132,12 @@ func NewApplicationListCommand() *cobra.Command {
|
|||
defer util.Close(conn)
|
||||
apps, err := appIf.List(context.Background(), &application.ApplicationQuery{})
|
||||
errors.CheckError(err)
|
||||
for _, c := range apps.Items {
|
||||
fmt.Printf("%s\n", c.Name)
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintf(w, "NAME\tCLUSTER\tNAMESPACE\tSTATUS\n")
|
||||
for _, app := range apps.Items {
|
||||
fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", app.Name, app.Status.ComparisonResult.Server, app.Status.ComparisonResult.Namespace, app.Status.ComparisonResult.Status)
|
||||
}
|
||||
_ = w.Flush()
|
||||
},
|
||||
}
|
||||
return command
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*Ap
|
|||
}
|
||||
var syncRes ApplicationSyncResult
|
||||
switch app.Status.ComparisonResult.Status {
|
||||
case appv1.ComparisonStatusEqual:
|
||||
case appv1.ComparisonStatusDifferent:
|
||||
default:
|
||||
appState := app.Status.ComparisonResult.Status
|
||||
|
|
@ -156,7 +157,7 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*Ap
|
|||
}
|
||||
syncRes.Resources = append(syncRes.Resources, &resDetails)
|
||||
}
|
||||
syncRes.Message = "synced successful"
|
||||
syncRes.Message = "successfully synced"
|
||||
return &syncRes, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue