Documentation
¶
Index ¶
- Constants
- Variables
- func DoCleanup() bool
- func GenerateRsyslogConf(conf string, rfc SyslogRfc) string
- func NewKubeClient() (*kubernetes.Clientset, *rest.Config)
- func RunCleanupScript()
- type AuthorizationBuilder
- type ContainerLogSimpleMeta
- type E2ETestFramework
- func (tc *E2ETestFramework) AddCleanup(fn func() error)
- func (tc *E2ETestFramework) BuildAuthorizationFor(saNamespace, saName string) *AuthorizationBuilder
- func (tc *E2ETestFramework) Cleanup()
- func (tc *E2ETestFramework) Client() *kubernetes.Clientset
- func (tc *E2ETestFramework) Create(obj crclient.Object) error
- func (tc *E2ETestFramework) CreateLegacySyslogConfigMap(namespace, conf string) (err error)
- func (tc *E2ETestFramework) CreateNamespace(name string) string
- func (tc *E2ETestFramework) CreateObservabilityClusterLogForwarder(forwarder *obs.ClusterLogForwarder) error
- func (tc *E2ETestFramework) CreatePipelineSecret(namespace, logStoreName, secretName string, otherData map[string][]byte) (*corev1.Secret, error)
- func (tc *E2ETestFramework) CreateSyslogReceiverSecrets(testDir, logStoreName, secretName string) (secret *corev1.Secret, err error)
- func (tc *E2ETestFramework) CreateTestNamespace() string
- func (tc *E2ETestFramework) CreateTestNamespaceWithPrefix(prefix string) string
- func (tc *E2ETestFramework) DeployCURLLogGenerator(endpoint string) (string, error)
- func (tc *E2ETestFramework) DeployCURLLogGeneratorWithNamespaceAndEndpoint(namespace, endpoint string) error
- func (tc *E2ETestFramework) DeployFluentdReceiver(rootDir string, secure bool) (deployment *apps.Deployment, err error)
- func (tc *E2ETestFramework) DeployFluentdReceiverWithConf(namespace string, secure bool, fluentConf string) (deployment *apps.Deployment, err error)
- func (tc *E2ETestFramework) DeployHttpReceiver(ns string) (deployment *VectorHttpReceiverLogStore, err error)
- func (tc *E2ETestFramework) DeployKafkaReceiver(topics []string) (*apps.StatefulSet, error)
- func (tc *E2ETestFramework) DeployLogGenerator() (string, error)
- func (tc *E2ETestFramework) DeployLogGeneratorWithNamespace(namespace, name string, options LogGeneratorOptions) error
- func (tc *E2ETestFramework) DeployLogGeneratorWithNamespaceName(namespace, name string, options LogGeneratorOptions) error
- func (tc *E2ETestFramework) DeployLokiOperator() error
- func (tc *E2ETestFramework) DeployLokistackInNamespace(namespace string) (ls *LokistackLogStore, err error)
- func (tc *E2ETestFramework) DeployMinio() error
- func (tc *E2ETestFramework) DeploySocat(namespace, name, forwarderName string, options LogGeneratorOptions) error
- func (tc *E2ETestFramework) DeploySplunk() (*apps.StatefulSet, error)
- func (tc *E2ETestFramework) DeploySyslogReceiver(testDir string, protocol corev1.Protocol, withTLS bool, rfc SyslogRfc) (deployment *apps.Deployment, err error)
- func (tc *E2ETestFramework) PodExec(namespace, pod, container string, command []string) (string, error)
- func (tc *E2ETestFramework) WaitFor(component helpers.LogComponentType) error
- func (tc *E2ETestFramework) WaitForCleanupCompletion(namespace string, podlabels []string)
- func (tc *E2ETestFramework) WaitForDaemonSet(namespace, name string) error
- func (tc *E2ETestFramework) WaitForDeployment(namespace, name string, retryInterval, timeout time.Duration) error
- func (tc *E2ETestFramework) WaitForLokistackReady(namespace string) error
- func (tc *E2ETestFramework) WaitForResourceCondition(namespace, kind, name, selector, jsonPath string, maxtimes int, ...) error
- type LogGeneratorOptions
- type LogStore
- type LokistackLogStore
- func (ls LokistackLogStore) ExternalURL(path string) (*url.URL, error)
- func (ls LokistackLogStore) GetApplicationLogs(saName string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
- func (ls LokistackLogStore) GetApplicationLogsByKeyValue(saName, key, value string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
- func (ls LokistackLogStore) GetApplicationLogsWithPipeline(saName, expression string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
- func (ls LokistackLogStore) HasApplicationLogs(saName string, timeToWait time.Duration) (bool, error)
- func (ls LokistackLogStore) HasAuditLogs(saName string, timeToWait time.Duration) (bool, error)
- func (ls LokistackLogStore) HasInfrastructureLogs(saName string, timeToWait time.Duration) (bool, error)
- func (ls LokistackLogStore) Query(logQL string, orgID, tenant, saName string, limit int) ([]lokitesthelper.StreamValues, error)
- func (ls LokistackLogStore) QueryUntil(logQL string, orgID, tenant, saName string, n int, timeToWait time.Duration) (values []lokitesthelper.StreamValues, err error)
- type Query
- type SyslogRfc
- type VectorHttpReceiverLogStore
- func (v VectorHttpReceiverLogStore) ApplicationLogs(timeToWait time.Duration) (types.Logs, error)
- func (v VectorHttpReceiverLogStore) ClusterLocalEndpoint() string
- func (v VectorHttpReceiverLogStore) GrepLogs(expr string, timeToWait time.Duration) (string, error)
- func (v VectorHttpReceiverLogStore) HasApplicationLogs(timeToWait time.Duration) (bool, error)
- func (v VectorHttpReceiverLogStore) HasAuditLogs(timeToWait time.Duration) (bool, error)
- func (v VectorHttpReceiverLogStore) HasInfraStructureLogs(timeToWait time.Duration) (bool, error)
- func (v VectorHttpReceiverLogStore) ListContainers() (containers []string)
- func (v VectorHttpReceiverLogStore) ListJournalLogs() ([]types.JournalLog, error)
- func (v VectorHttpReceiverLogStore) ListNamespaces() (namespaces []string)
- func (v VectorHttpReceiverLogStore) Query(timeout *time.Duration) (*Query, error)
- func (v VectorHttpReceiverLogStore) RetrieveLogs() (map[string]string, error)
- func (v VectorHttpReceiverLogStore) RunCmd(cmd string, timeout *time.Duration) (string, error)
Constants ¶
View Source
const ( FluentdSecretName = receiverName UnsecureFluentConf = `` /* 575-byte string literal not displayed */ FluentConfHTTPWithTLS = `` /* 828-byte string literal not displayed */ )
View Source
const ( DefaultCleanUpTimeout = 60.0 * 5 DefaultWaitForLogsTimeout = 5 * time.Minute )
View Source
const ( SplunkStandalone = "splunk-standalone" Splunk = "splunk" SplunkHecService = "splunk-hec-service" )
View Source
const ( SyslogReceiverName = "syslog-receiver" ImageRemoteSyslog = "registry.redhat.io/rhel8/rsyslog:8.7-9" )
View Source
const ( TcpSyslogInput = `` /* 191-byte string literal not displayed */ TcpSyslogInputWithTLS = `` /* 597-byte string literal not displayed */ UdpSyslogInput = `` /* 191-byte string literal not displayed */ UdpSyslogInputWithTLS = `` /* 626-byte string literal not displayed */ RuleSetRfc5424 = `` /* 159-byte string literal not displayed */ RuleSetRfc3164 = `` /* 307-byte string literal not displayed */ // includes both rfc parsers RuleSetRfc3164Rfc5424 = `` /* 177-byte string literal not displayed */ )
View Source
const (
HttpReceiver = "http-receiver"
)
View Source
const (
LokistackName = "lokistack-dev"
)
Variables ¶
View Source
var ( ClusterRoleCollectApplicationLogs = fmt.Sprintf(roleFmt, obsv1.InputTypeApplication) ClusterRoleCollectInfrastructureLogs = fmt.Sprintf(roleFmt, obsv1.InputTypeInfrastructure) ClusterRoleCollectAuditLogs = fmt.Sprintf(roleFmt, obsv1.InputTypeAudit) ClusterRoleAllLogsWriter = "logging-collector-logs-writer" ClusterRoleAllLogsReader = "logging-collector-logs-reader" )
View Source
var ( HecToken = rand.Word(16) AdminPassword = rand.Word(16) SplunkEndpoint = url.URL{ Scheme: "http", Host: fmt.Sprintf("%s:%d", SplunkHecService, splunkHecPort), } )
Functions ¶
func GenerateRsyslogConf ¶
func NewKubeClient ¶
func NewKubeClient() (*kubernetes.Clientset, *rest.Config)
NewKubeClient returns a client using the KUBECONFIG env var or incluster settings
func RunCleanupScript ¶
func RunCleanupScript()
Types ¶
type AuthorizationBuilder ¶
type AuthorizationBuilder struct {
// contains filtered or unexported fields
}
func (*AuthorizationBuilder) AllowClusterRole ¶
func (b *AuthorizationBuilder) AllowClusterRole(roleName string) *AuthorizationBuilder
func (*AuthorizationBuilder) Create ¶
func (b *AuthorizationBuilder) Create() (sa *corev1.ServiceAccount, err error)
type ContainerLogSimpleMeta ¶
func NewLogSimpleMeta ¶
func NewLogSimpleMeta(parts []string) *ContainerLogSimpleMeta
type E2ETestFramework ¶
type E2ETestFramework struct { RestConfig *rest.Config KubeClient *kubernetes.Clientset CleanupFns []func() error LogStores map[string]LogStore Test *client.Test }
func NewE2ETestFramework ¶
func NewE2ETestFramework() *E2ETestFramework
func (*E2ETestFramework) AddCleanup ¶
func (tc *E2ETestFramework) AddCleanup(fn func() error)
func (*E2ETestFramework) BuildAuthorizationFor ¶
func (tc *E2ETestFramework) BuildAuthorizationFor(saNamespace, saName string) *AuthorizationBuilder
func (*E2ETestFramework) Cleanup ¶
func (tc *E2ETestFramework) Cleanup()
func (*E2ETestFramework) Client ¶
func (tc *E2ETestFramework) Client() *kubernetes.Clientset
func (*E2ETestFramework) Create ¶
func (tc *E2ETestFramework) Create(obj crclient.Object) error
Create (re)creates an object
func (*E2ETestFramework) CreateLegacySyslogConfigMap ¶
func (tc *E2ETestFramework) CreateLegacySyslogConfigMap(namespace, conf string) (err error)
func (*E2ETestFramework) CreateNamespace ¶
func (tc *E2ETestFramework) CreateNamespace(name string) string
func (*E2ETestFramework) CreateObservabilityClusterLogForwarder ¶
func (tc *E2ETestFramework) CreateObservabilityClusterLogForwarder(forwarder *obs.ClusterLogForwarder) error
func (*E2ETestFramework) CreatePipelineSecret ¶
func (*E2ETestFramework) CreateSyslogReceiverSecrets ¶
func (tc *E2ETestFramework) CreateSyslogReceiverSecrets(testDir, logStoreName, secretName string) (secret *corev1.Secret, err error)
func (*E2ETestFramework) CreateTestNamespace ¶
func (tc *E2ETestFramework) CreateTestNamespace() string
func (*E2ETestFramework) CreateTestNamespaceWithPrefix ¶
func (tc *E2ETestFramework) CreateTestNamespaceWithPrefix(prefix string) string
func (*E2ETestFramework) DeployCURLLogGenerator ¶
func (tc *E2ETestFramework) DeployCURLLogGenerator(endpoint string) (string, error)
func (*E2ETestFramework) DeployCURLLogGeneratorWithNamespaceAndEndpoint ¶
func (tc *E2ETestFramework) DeployCURLLogGeneratorWithNamespaceAndEndpoint(namespace, endpoint string) error
func (*E2ETestFramework) DeployFluentdReceiver ¶
func (tc *E2ETestFramework) DeployFluentdReceiver(rootDir string, secure bool) (deployment *apps.Deployment, err error)
func (*E2ETestFramework) DeployFluentdReceiverWithConf ¶
func (tc *E2ETestFramework) DeployFluentdReceiverWithConf(namespace string, secure bool, fluentConf string) (deployment *apps.Deployment, err error)
func (*E2ETestFramework) DeployHttpReceiver ¶
func (tc *E2ETestFramework) DeployHttpReceiver(ns string) (deployment *VectorHttpReceiverLogStore, err error)
func (*E2ETestFramework) DeployKafkaReceiver ¶
func (tc *E2ETestFramework) DeployKafkaReceiver(topics []string) (*apps.StatefulSet, error)
func (*E2ETestFramework) DeployLogGenerator ¶
func (tc *E2ETestFramework) DeployLogGenerator() (string, error)
func (*E2ETestFramework) DeployLogGeneratorWithNamespace ¶
func (tc *E2ETestFramework) DeployLogGeneratorWithNamespace(namespace, name string, options LogGeneratorOptions) error
func (*E2ETestFramework) DeployLogGeneratorWithNamespaceName ¶
func (tc *E2ETestFramework) DeployLogGeneratorWithNamespaceName(namespace, name string, options LogGeneratorOptions) error
func (*E2ETestFramework) DeployLokiOperator ¶
func (tc *E2ETestFramework) DeployLokiOperator() error
func (*E2ETestFramework) DeployLokistackInNamespace ¶
func (tc *E2ETestFramework) DeployLokistackInNamespace(namespace string) (ls *LokistackLogStore, err error)
func (*E2ETestFramework) DeployMinio ¶
func (tc *E2ETestFramework) DeployMinio() error
func (*E2ETestFramework) DeploySocat ¶
func (tc *E2ETestFramework) DeploySocat(namespace, name, forwarderName string, options LogGeneratorOptions) error
DeploySocat will deploy pod with socat software
func (*E2ETestFramework) DeploySplunk ¶
func (tc *E2ETestFramework) DeploySplunk() (*apps.StatefulSet, error)
func (*E2ETestFramework) DeploySyslogReceiver ¶
func (tc *E2ETestFramework) DeploySyslogReceiver(testDir string, protocol corev1.Protocol, withTLS bool, rfc SyslogRfc) (deployment *apps.Deployment, err error)
func (*E2ETestFramework) PodExec ¶
func (tc *E2ETestFramework) PodExec(namespace, pod, container string, command []string) (string, error)
func (*E2ETestFramework) WaitFor ¶
func (tc *E2ETestFramework) WaitFor(component helpers.LogComponentType) error
func (*E2ETestFramework) WaitForCleanupCompletion ¶
func (tc *E2ETestFramework) WaitForCleanupCompletion(namespace string, podlabels []string)
func (*E2ETestFramework) WaitForDaemonSet ¶
func (tc *E2ETestFramework) WaitForDaemonSet(namespace, name string) error
func (*E2ETestFramework) WaitForDeployment ¶
func (tc *E2ETestFramework) WaitForDeployment(namespace, name string, retryInterval, timeout time.Duration) error
func (*E2ETestFramework) WaitForLokistackReady ¶
func (tc *E2ETestFramework) WaitForLokistackReady(namespace string) error
func (*E2ETestFramework) WaitForResourceCondition ¶
func (tc *E2ETestFramework) WaitForResourceCondition(namespace, kind, name, selector, jsonPath string, maxtimes int, isSatisfied func(string) (bool, error)) error
WaitForResourceCondition retrieves resource info given a selector and evaluates the jsonPath output against the provided condition.
type LogGeneratorOptions ¶
type LogGeneratorOptions struct { Count int Delay time.Duration Message string ContainerCount int Labels map[string]string }
func NewDefaultLogGeneratorOptions ¶
func NewDefaultLogGeneratorOptions() LogGeneratorOptions
type LogStore ¶
type LogStore interface { //ApplicationLogs returns app logs for a given log store ApplicationLogs(timeToWait time.Duration) (types.Logs, error) HasApplicationLogs(timeToWait time.Duration) (bool, error) HasInfraStructureLogs(timeToWait time.Duration) (bool, error) HasAuditLogs(timeToWait time.Duration) (bool, error) GrepLogs(expr string, timeToWait time.Duration) (string, error) RetrieveLogs() (map[string]string, error) ClusterLocalEndpoint() string }
type LokistackLogStore ¶
type LokistackLogStore struct { Name string Namespace string // contains filtered or unexported fields }
func (LokistackLogStore) ExternalURL ¶
func (ls LokistackLogStore) ExternalURL(path string) (*url.URL, error)
ExternalURL returns the URL of the external route.
func (LokistackLogStore) GetApplicationLogs ¶
func (ls LokistackLogStore) GetApplicationLogs(saName string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
func (LokistackLogStore) GetApplicationLogsByKeyValue ¶
func (ls LokistackLogStore) GetApplicationLogsByKeyValue(saName, key, value string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
func (LokistackLogStore) GetApplicationLogsWithPipeline ¶
func (ls LokistackLogStore) GetApplicationLogsWithPipeline(saName, expression string, timeToWait time.Duration) ([]lokitesthelper.StreamValues, error)
func (LokistackLogStore) HasApplicationLogs ¶
func (LokistackLogStore) HasAuditLogs ¶
func (LokistackLogStore) HasInfrastructureLogs ¶
func (LokistackLogStore) Query ¶
func (ls LokistackLogStore) Query(logQL string, orgID, tenant, saName string, limit int) ([]lokitesthelper.StreamValues, error)
func (LokistackLogStore) QueryUntil ¶
func (ls LokistackLogStore) QueryUntil(logQL string, orgID, tenant, saName string, n int, timeToWait time.Duration) (values []lokitesthelper.StreamValues, err error)
QueryUntil repeats the query until at least n lines are received.
type Query ¶
type Query struct { Meta []ContainerLogSimpleMeta // contains filtered or unexported fields }
type SyslogRfc ¶
type SyslogRfc int
SyslogRfc type is the rfc used for sending syslog
func MustParseRFC ¶
type VectorHttpReceiverLogStore ¶
type VectorHttpReceiverLogStore struct { *apps.Deployment // contains filtered or unexported fields }
func (VectorHttpReceiverLogStore) ApplicationLogs ¶
func (VectorHttpReceiverLogStore) ClusterLocalEndpoint ¶
func (v VectorHttpReceiverLogStore) ClusterLocalEndpoint() string
func (VectorHttpReceiverLogStore) HasApplicationLogs ¶
func (v VectorHttpReceiverLogStore) HasApplicationLogs(timeToWait time.Duration) (bool, error)
func (VectorHttpReceiverLogStore) HasAuditLogs ¶
func (v VectorHttpReceiverLogStore) HasAuditLogs(timeToWait time.Duration) (bool, error)
func (VectorHttpReceiverLogStore) HasInfraStructureLogs ¶
func (v VectorHttpReceiverLogStore) HasInfraStructureLogs(timeToWait time.Duration) (bool, error)
func (VectorHttpReceiverLogStore) ListContainers ¶
func (v VectorHttpReceiverLogStore) ListContainers() (containers []string)
func (VectorHttpReceiverLogStore) ListJournalLogs ¶
func (v VectorHttpReceiverLogStore) ListJournalLogs() ([]types.JournalLog, error)
func (VectorHttpReceiverLogStore) ListNamespaces ¶
func (v VectorHttpReceiverLogStore) ListNamespaces() (namespaces []string)
func (VectorHttpReceiverLogStore) Query ¶
func (v VectorHttpReceiverLogStore) Query(timeout *time.Duration) (*Query, error)
Query queries the receiver with a timeout for the request and returns a simple list of the meta available
func (VectorHttpReceiverLogStore) RetrieveLogs ¶
func (v VectorHttpReceiverLogStore) RetrieveLogs() (map[string]string, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.