Documentation
¶
Index ¶
- Constants
- func GetKServiceLogs(ctx context.Context, opts LogsOptions, out io.Writer) error
- func IsCRDNotFoundError(err error) bool
- func NewEventingClient(namespace string) (clienteventingv1.KnEventingClient, error)
- func NewServingClient(namespace string) (clientservingv1.KnServingClient, error)
- func UsesKnativeDeployer(annotations map[string]string) bool
- type Deployer
- type DeployerOpt
- type Describer
- type DescriberOpt
- type Lister
- type LogsOptions
- type Remover
Constants ¶
const (
KnativeDeployerName = deployers.Knative
)
const RemoveTimeout = 120 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GetKServiceLogs ¶
GetKServiceLogs will get logs of Knative service.
It will do so by gathering logs of user-container of all affiliated pods.
When opts.Follow is set, this function runs as long as the passed context is active (i.e. it is required to cancel the context to stop log gathering). Otherwise a snapshot of the currently available logs is written and the function returns, with k8s.ErrNoMatchingPods if the service currently has no pods whose logs can be read.
func IsCRDNotFoundError ¶ added in v0.48.0
IsCRDNotFoundError checks if the given error indicates that a requested Kind could not be found and thus the CRD most likely is not installed
func NewEventingClient ¶
func NewEventingClient(namespace string) (clienteventingv1.KnEventingClient, error)
func NewServingClient ¶
func NewServingClient(namespace string) (clientservingv1.KnServingClient, error)
func UsesKnativeDeployer ¶ added in v0.48.0
Types ¶
type Deployer ¶
type Deployer struct {
// contains filtered or unexported fields
}
func NewDeployer ¶
func NewDeployer(opts ...DeployerOpt) *Deployer
type DeployerOpt ¶
type DeployerOpt func(*Deployer)
func WithDeployerDecorator ¶
func WithDeployerDecorator(decorator deployer.DeployDecorator) DeployerOpt
func WithDeployerVerbose ¶
func WithDeployerVerbose(verbose bool) DeployerOpt
type Describer ¶
type Describer struct {
// contains filtered or unexported fields
}
func NewDescriber ¶
func NewDescriber(verbose bool, opts ...DescriberOpt) *Describer
func (*Describer) Describe ¶
Describe a function by name. Note that the consuming API uses domain style notation, whereas Kubernetes restricts to label-syntax, which is thus escaped. Therefore as a knative (kube) implementation detail proper full names have to be escaped on the way in and unescaped on the way out. ex: www.example-site.com -> www-example--site-com
type DescriberOpt ¶ added in v0.49.0
type DescriberOpt func(*Describer)
func WithDescriberTransport ¶ added in v0.49.0
func WithDescriberTransport(transport http.RoundTripper) DescriberOpt
type LogsOptions ¶ added in v0.51.0
type LogsOptions struct {
// Name of the Knative service whose logs are gathered.
Name string
// Namespace of the Knative service. An empty value resolves to the
// currently active namespace.
Namespace string
// Image, when non-empty, restricts gathering to pods running this exact
// image, which must be in digest format since pods of a Knative service
// use it. Useful to isolate the logs of a single revision.
Image string
// Since, when non-nil, is the time from which logs are returned.
Since *time.Time
// TailLines, when non-nil, limits the output to the last N lines per pod.
TailLines *int64
// Follow streams logs until the context is cancelled. When false, the
// logs currently available are written and the call returns.
Follow bool
}
LogsOptions are the parameters of GetKServiceLogs.