datasource

package
v0.0.0-...-20e6130 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: BSD-2-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource interface {
	StatusUpdater
	GetNamespaces(ctx context.Context) ([]*NamespaceConfig, error)
	WriteCurrentConfigHash(namespace string, hash string)
}

Datasource reads data from k8s

func NewFakeDatasource

func NewFakeDatasource(ctx context.Context) Datasource

NewFakeDatasource returns a predefined set of namespaces + configs

func NewFileSystemDatasource

func NewFileSystemDatasource(ctx context.Context, rootDir string, statusOutputDir string) Datasource

NewFileSystemDatasource turns all files matching *.conf patter in the given dir into namespace configs

func NewKubernetesInformerDatasource

func NewKubernetesInformerDatasource(ctx context.Context, cfg *config.Config, updateChan chan time.Time) (Datasource, error)

NewKubernetesInformerDatasource builds a new Datasource from the provided config. The returned Datasource uses Informers to efficiently track objects in the kubernetes API by watching for updates to a known state.

type MiniContainer

type MiniContainer struct {
	// the pod id
	PodID   string
	PodName string

	Image       string
	ContainerID string

	// pod labels
	Labels map[string]string

	// container name
	Name string
	// only the emptyDir mounts, never empty, sorted by len(Path), descending
	HostMounts []*Mount

	NodeName string
}

MiniContainer container subset with the parent pod's metadata

type Mount

type Mount struct {
	Path       string
	VolumeName string
	SubPath    string
}

type NamespaceConfig

type NamespaceConfig struct {
	Name               string
	FluentdConfig      string
	PreviousConfigHash string
	MiniContainers     []*MiniContainer
	Labels             map[string]string
}

NamespaceConfig holds all relevant data for a namespace

type StatusUpdater

type StatusUpdater interface {
	UpdateStatus(ctx context.Context, namespace string, status string)
}

StatusUpdater sets an error description on the namespace in case configuration cannot be applied or an empty string otherwise

Directories

Path Synopsis
fluentdconfig/client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
fluentdconfig/client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
fluentdconfig/client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
fluentdconfig/client/clientset/versioned/typed/logs.vdp.vmware.com/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
fluentdconfig/client/clientset/versioned/typed/logs.vdp.vmware.com/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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