Skip to content

Conversation

loheagn
Copy link
Contributor

@loheagn loheagn commented May 18, 2022

This PR adds the logs subcommand.

The usage of this subcommand is:

$ ofn logs -h
Get the logs from the serving pods created by the function

Usage:
  ofn logs [OPTIONS] FUNCTION_NAME [CONTAINER_NAME]

Examples:

  # Get tht logs from the 'function' container in the serving pods created by the function whose name is 'demo-function'
  ofn logs demo-function

  # Get tht logs from the 'extra' container (a container whose name is not 'function') in the serving pods created by the function whose name is 'demo-function'
  ofn logs demo-function extra

  # Begin streaming the logs from the 'function' container in the serving pods created by the function whose name is 'demo-function'
  ofn logs -f demo-function


Flags:
  -f, --follow   Specify if the logs should be streamed
  -h, --help     help for logs

Global Flags:
      --as string                      Username to impersonate for the operation
      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --cache-dir string               Default cache directory (default "/Users/loheagn/.kube/cache")
      --certificate-authority string   Path to a cert file for the certificate authority
      --client-certificate string      Path to a client certificate file for TLS
      --client-key string              Path to a client key file for TLS
      --cluster string                 The name of the kubeconfig cluster to use
      --context string                 The name of the kubeconfig context to use
      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
  -n, --namespace string               If present, the namespace scope for this CLI request
      --password string                Password for basic authentication to the API server
      --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
  -s, --server string                  The address and port of the Kubernetes API server
      --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use
      --username string                Username for basic authentication to the API server

Fix #36

Signed-off-by: loheagn loheagn@icloud.com

Signed-off-by: loheagn <loheagn@icloud.com>
@CLAassistant
Copy link

CLAassistant commented May 18, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@tpiperatgod tpiperatgod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, @benjaminhuo @wentevill can you help review this?

Copy link
Member

@wentevill wentevill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tpiperatgod tpiperatgod merged commit a85a24f into OpenFunction:main May 19, 2022
@benjaminhuo
Copy link
Member

Thanks @loheagn, This is a pretty good PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ofn to get the function's logs
5 participants