logging

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: UPL-1.0 Imports: 13 Imported by: 0

Documentation

Overview

Package logging is a generated GoMock package.

Index

Constants

View Source
const (
	FluentdStdoutSidecarName = "fluentd-stdout-sidecar"
)

Variables

View Source
var DefaultFluentdImage string

DefaultFluentdImage holds the default FLUENTD image that will be used if it is not specified in the logging logInfo

Functions

This section is empty.

Types

type Fluentd

type Fluentd struct {
	k8sclient.Client
	Log                    *zap.SugaredLogger
	Context                context.Context
	ParseRules             string
	StorageVolumeName      string
	StorageVolumeMountPath string
	WorkloadType           string
}

Fluentd is an implementation of FluentdManager.

func (*Fluentd) Apply

func (f *Fluentd) Apply(logInfo *LogInfo, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) error

Apply applies FLUENTD configuration to create/update FLUENTD container, configmap, volumes and volume mounts. Returns true if any changes are made; false otherwise.

func (*Fluentd) Remove

func (f *Fluentd) Remove(logInfo *LogInfo, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) bool

Remove removes FLUENTD container, configmap, volumes and volume mounts. Returns whether the remove action has been verified so that the caller knows when it is safe to forget the association.

type FluentdManager

type FluentdManager interface {
	Apply(logInfo *LogInfo, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) error
	Remove(logInfo *LogInfo, resource vzapi.QualifiedResourceRelation, fluentdPod *FluentdPod) bool
}

FluentdManager is a general interface to interact with FLUENTD related resources

type FluentdPod

type FluentdPod struct {
	Containers   []corev1.Container
	Volumes      []corev1.Volume
	VolumeMounts []corev1.VolumeMount
	HandlerEnv   []corev1.EnvVar
	LogPath      string
}

FluentdPod contains pod information for pods which require FLUENTD integration

type Handler

type Handler interface {
	Apply(ctx context.Context, resource vzapi.QualifiedResourceRelation, info *LogInfo) (*ctrl.Result, error)
	Remove(ctx context.Context, resource vzapi.QualifiedResourceRelation, info *LogInfo) (bool, error)
}

Handler abstracts the FLUENTD integration for components

type LogInfo

type LogInfo struct {
	// The fluentd image
	FluentdImage string
}

LogInfo contains information needed for logging

func NewLogInfo

func NewLogInfo() *LogInfo

NewLogInfo creates and populates a new logging info

type MockFluentdManager

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

MockFluentdManager is a mock of FluentdManager interface.

func NewMockFluentdManager

func NewMockFluentdManager(ctrl *gomock.Controller) *MockFluentdManager

NewMockFluentdManager creates a new mock instance.

func (*MockFluentdManager) Apply

func (m *MockFluentdManager) Apply(logInfo *LogInfo, resource v1alpha1.QualifiedResourceRelation, fluentdPod *FluentdPod) error

Apply mocks base method.

func (*MockFluentdManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFluentdManager) Remove

func (m *MockFluentdManager) Remove(logInfo *LogInfo, resource v1alpha1.QualifiedResourceRelation, fluentdPod *FluentdPod) bool

Remove mocks base method.

type MockFluentdManagerMockRecorder

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

MockFluentdManagerMockRecorder is the mock recorder for MockFluentdManager.

func (*MockFluentdManagerMockRecorder) Apply

func (mr *MockFluentdManagerMockRecorder) Apply(logInfo, resource, fluentdPod interface{}) *gomock.Call

Apply indicates an expected call of Apply.

func (*MockFluentdManagerMockRecorder) Remove

func (mr *MockFluentdManagerMockRecorder) Remove(logInfo, resource, fluentdPod interface{}) *gomock.Call

Remove indicates an expected call of Remove.

Jump to

Keyboard shortcuts

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