Skip to content

Commit

Permalink
fix: Add timezone to projectwindows list (argoproj#15929)
Browse files Browse the repository at this point in the history
* list timezone in default list windows

Signed-off-by: Joseph Perez <perezj0230@gmail.com>

* add list example

Signed-off-by: Joseph Perez <perezj0230@gmail.com>

* clidocsgen

Signed-off-by: Joseph Perez <perezj0230@gmail.com>

---------

Signed-off-by: Joseph Perez <perezj0230@gmail.com>
  • Loading branch information
josephperez3 authored and ymktmk committed Oct 29, 2023
1 parent 44ff81a commit cbcb53b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/argocd/commands/projectwindows.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ func NewProjectWindowsListCommand(clientOpts *argocdclient.ClientOptions) *cobra
var command = &cobra.Command{
Use: "list PROJECT",
Short: "List project sync windows",
Example: `# List project windows
argocd proj windows list PROJECT
# List project windows in yaml format
argocd proj windows list PROJECT -o yaml
`,
Run: func(c *cobra.Command, args []string) {
ctx := c.Context()

Expand Down Expand Up @@ -306,8 +312,8 @@ func NewProjectWindowsListCommand(clientOpts *argocdclient.ClientOptions) *cobra
func printSyncWindows(proj *v1alpha1.AppProject) {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
var fmtStr string
headers := []interface{}{"ID", "STATUS", "KIND", "SCHEDULE", "DURATION", "APPLICATIONS", "NAMESPACES", "CLUSTERS", "MANUALSYNC"}
fmtStr = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n"
headers := []interface{}{"ID", "STATUS", "KIND", "SCHEDULE", "DURATION", "APPLICATIONS", "NAMESPACES", "CLUSTERS", "MANUALSYNC", "TIMEZONE"}
fmtStr = strings.Repeat("%s\t", len(headers)) + "\n"
fmt.Fprintf(w, fmtStr, headers...)
if proj.Spec.SyncWindows.HasWindows() {
for i, window := range proj.Spec.SyncWindows {
Expand All @@ -321,6 +327,7 @@ func printSyncWindows(proj *v1alpha1.AppProject) {
formatListOutput(window.Namespaces),
formatListOutput(window.Clusters),
formatManualOutput(window.ManualSync),
window.TimeZone,
}
fmt.Fprintf(w, fmtStr, vals...)
}
Expand Down
11 changes: 11 additions & 0 deletions docs/user-guide/commands/argocd_proj_windows_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ List project sync windows
argocd proj windows list PROJECT [flags]
```

### Examples

```
# List project windows
argocd proj windows list PROJECT
# List project windows in yaml format
argocd proj windows list PROJECT -o yaml
```

### Options

```
Expand Down

0 comments on commit cbcb53b

Please sign in to comment.