kubedog

package
v0.41.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TrackTerminationModeAnnoName annotation allows to specify how to track resource.
	TrackTerminationModeAnnoName = helper.RootAnnoName + "track-termination-mode"

	// FailModeAnnoName annotation specifies what to do after resource fails.
	FailModeAnnoName = helper.RootAnnoName + "fail-mode"

	// FailuresAllowedPerReplicaAnnoName specifies how many times resource is allowed to fail.
	FailuresAllowedPerReplicaAnnoName = helper.RootAnnoName + "failures-allowed-per-replica"

	// LogRegexAnnoName allows to set regexp for log lines.
	LogRegexAnnoName = helper.RootAnnoName + "log-regex"

	// LogRegexForAnnoPrefix allows to set regexp for individual containers.
	LogRegexForAnnoPrefix = helper.RootAnnoName + "log-regex-for-"

	// SkipLogsAnnoName allows to skip log streaming.
	SkipLogsAnnoName = helper.RootAnnoName + "skip-logs"

	// SkipLogsForContainersAnnoName allows to skip log streaming for individual containers.
	SkipLogsForContainersAnnoName = helper.RootAnnoName + "skip-logs-for-containers"

	// ShowLogsOnlyForContainersAnnoName allows to show logs only for specified containers.
	ShowLogsOnlyForContainersAnnoName = helper.RootAnnoName + "show-logs-only-for-containers"

	// ShowEventsAnnoName enables streaming resource events.
	ShowEventsAnnoName = helper.RootAnnoName + "show-service-messages"
)

Variables

This section is empty.

Functions

func FixLog added in v0.27.1

func FixLog(ctx context.Context, width int)

FixLog will disable kubernetes logger and fix width for logboek.

func MakeSpecs

func MakeSpecs(m []Resource, ns string, trackGeneric bool) (*multitrack.MultitrackSpecs, error)

MakeSpecs creates *multitrack.MultitrackSpecs for Resource slice in provided namespace.

func NewEmptyContainerNameError added in v0.31.1

func NewEmptyContainerNameError(annotation, value string) error

func NewInvalidValueError added in v0.31.1

func NewInvalidValueError[T ~string](annotation string, value T, choices []T) error

func NewParseError added in v0.31.1

func NewParseError(typ, value string, err error) error

func SilenceKlog added in v0.20.0

func SilenceKlog(ctx context.Context) error

SilenceKlog discards all klog logs except FATAL.

func SilenceKlogV2 added in v0.20.0

func SilenceKlogV2(ctx context.Context) error

SilenceKlogV2 discards all klog/v2 logs except FATAL.

Types

type Config

type Config struct {
	Enabled        bool
	TrackGeneric   bool
	StatusInterval time.Duration
	Timeout        time.Duration
	StartDelay     time.Duration
	LogWidth       int
}

Config is config for kubedog library.

type EmptyContainerNameError added in v0.31.1

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

func (EmptyContainerNameError) Error added in v0.31.1

func (err EmptyContainerNameError) Error() string

type InvalidValueError added in v0.31.1

type InvalidValueError[T ~string] struct {
	// contains filtered or unexported fields
}

func (InvalidValueError[T]) Error added in v0.31.1

func (err InvalidValueError[T]) Error() string

type ParseError added in v0.31.1

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

func (ParseError) Error added in v0.31.1

func (err ParseError) Error() string

func (ParseError) Unwrap added in v0.31.1

func (err ParseError) Unwrap() error

type Resource

type Resource struct {
	Spec             `yaml:"spec,omitempty" json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
	meta1.TypeMeta   `yaml:",inline" json:",inline"`
	meta1.ObjectMeta `yaml:"metadata,omitempty" json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}

Resource is base structure for all k8s resources that have replicas. Used to parse out replicas count.

func Parse added in v0.12.0

func Parse(yamlFile []byte) []Resource

Parse parses YAML manifests of kubernetes resources and returns Resource slice.

func (*Resource) DeepCopyObject added in v0.30.0

func (r *Resource) DeepCopyObject() runtime.Object

DeepCopyObject is required to implement runtime.Object interface. It doesn't actually do anything, don't use.

func (*Resource) MakeMultiTrackSpec

func (r *Resource) MakeMultiTrackSpec(ns string) (*multitrack.MultitrackSpec, error)

MakeMultiTrackSpec creates *multitrack.MultitrackSpec for current resource.

type Spec

type Spec struct {
	Replicas *uint32 `yaml:"replicas,omitempty" json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
}

Spec is spec structure with replicas. Only replicas count is used.

Jump to

Keyboard shortcuts

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