-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
174 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ func NewCmd() *cobra.Command { | |
NewGet(), | ||
NewWatch(), | ||
NewWait(), | ||
NewLogs(), | ||
) | ||
return root | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package action | ||
|
||
import ( | ||
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands" | ||
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client" | ||
|
||
"capact.io/capact/internal/cli" | ||
"capact.io/capact/internal/cli/heredoc" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewLogs returns a new cobra.Command for getting Action's logs. | ||
// TODO: this should be done via Gateway once the subscription is implemented. | ||
func NewLogs() *cobra.Command { | ||
cmd := commands.NewLogsCommand() | ||
cmd.Use = "logs ACTION [POD]" | ||
cmd.Short = "Print the Action's logs" | ||
cmd.Long = heredoc.Doc(` | ||
Print the Action's logs | ||
NOTE: An action needs to be created and run in order to run this command. | ||
This command calls the Kubernetes API directly. As a result, KUBECONFIG has to be configured | ||
with the same cluster as the one which the Gateway points to.`) | ||
|
||
cmd.Example = heredoc.WithCLIName(` | ||
# Print the logs of an Action: | ||
<cli> logs example | ||
# Follow the logs of an Action: | ||
<cli> logs example --follow | ||
# Print the logs of single container in a pod | ||
<cli> logs example step-pod -c step-pod-container | ||
# Print the logs of an Action's step: | ||
<cli> logs example step-pod | ||
# Print the logs of the latest executed Action: | ||
<cli> logs @latest | ||
`, cli.Name) | ||
|
||
client.AddKubectlFlagsToCmd(cmd) | ||
|
||
for _, hide := range argoHiddenFlags { | ||
_ = cmd.PersistentFlags().MarkHidden(hide) | ||
} | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: capact action logs | ||
--- | ||
|
||
## capact action logs | ||
|
||
Print the Action's logs | ||
|
||
### Synopsis | ||
|
||
Print the Action's logs | ||
|
||
NOTE: An action needs to be created and run in order to run this command. | ||
This command calls the Kubernetes API directly. As a result, KUBECONFIG has to be configured | ||
with the same cluster as the one which the Gateway points to. | ||
|
||
``` | ||
capact action logs ACTION [POD] [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Print the logs of an Action: | ||
capact logs example | ||
# Follow the logs of an Action: | ||
capact logs example --follow | ||
# Print the logs of single container in a pod | ||
capact logs example step-pod -c step-pod-container | ||
# Print the logs of an Action's step: | ||
capact logs example step-pod | ||
# Print the logs of the latest executed Action: | ||
capact logs @latest | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-c, --container string Print the logs of this container (default "main") | ||
-f, --follow Specify if the logs should be streamed. | ||
--grep string grep for lines | ||
-h, --help help for logs | ||
-n, --namespace string If present, the namespace scope for this CLI request | ||
--no-color Disable colorized output | ||
-p, --previous Specify if the previously terminated container logs should be returned. | ||
--since duration Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used. | ||
--since-time string Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used. | ||
--tail int If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime (default -1) | ||
--timestamps Include timestamps on each line in the log output | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-C, --config string Path to the YAML config file | ||
-v, --verbose int/string[=simple] Prints more verbose output. Allowed values: 0 - disable, 1 - simple, 2 - trace (default 0 - disable) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [capact action](capact_action.md) - This command consists of multiple subcommands to interact with target Actions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.