kubedog

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 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

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

func NewEmptyContainerNameError(annotation, value string) error

func NewInvalidValueError

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

func NewParseError

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

func SilenceKlog

func SilenceKlog(ctx context.Context) error

SilenceKlog discards all klog logs except FATAL.

func SilenceKlogV2

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

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

func (EmptyContainerNameError) Error

func (err EmptyContainerNameError) Error() string

type InvalidValueError

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

func (InvalidValueError[T]) Error

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

type ParseError

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

func (ParseError) Error

func (err ParseError) Error() string

func (ParseError) Unwrap

func (err ParseError) Unwrap() error

type Resource

type Resource struct {
	Spec             `yaml:"spec" json:"spec" protobuf:"bytes,2,opt,name=spec"`
	meta1.TypeMeta   `yaml:",inline" json:",inline"`
	meta1.ObjectMeta `yaml:"metadata" json:"metadata" 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

func Parse(yamlFile []byte) []Resource

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

func (*Resource) DeepCopyObject

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