file

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodMetaWriter

type PodMetaWriter struct {
	// contains filtered or unexported fields
}

PodMetaWriter is a PodMetaHandler that stores pod metadata in a specified directory. Files have a name format of `<namespace>_<pod_name>.meta` and are kept in `directory`.

func NewPodMetaWriter

func NewPodMetaWriter(directory string, retention time.Duration, logger *log.Logger) *PodMetaWriter

NewPodMetaWriter creates a new PodMetaWriter with specified directory and retention period.

func (*PodMetaWriter) Handle

func (w *PodMetaWriter) Handle(event exporter.PodEvent) error

Handle handles PodEvent. The exact behaviour depends on event type:

  • ADDED event - creates or updates file with metadata
  • MODIFIED event - creates or updates file with metadata
  • DELETED event - marks file for cleanup

We need to update file on MODIFIED event because ADDED can be sent when pod is still in a Pending state. As a result Fluent Bit won't be able to get container_image and container_hash from it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL