Documentation ¶
Index ¶
- Constants
- Variables
- func AddESOutput(version ElasticsearchVersion, b *runtime.PodBuilder, output obs.OutputSpec) error
- func CRIOTime(t time.Time) string
- func CreateAppLogFromJson(jsonstr string) string
- func GenerateConfigmapData() (data map[string]string, err error)
- func NewApplicationLogTemplate() types.ApplicationLog
- func NewAuditHostLog(eventTime time.Time) string
- func NewCRIOLogMessage(timestamp, message string, partial bool) string
- func NewCRIOLogMessageWithStream(timestamp, stream, message string, partial bool) string
- func NewContainerInfrastructureLogTemplate() types.ApplicationLog
- func NewFullCRIOLogMessage(timestamp, message string) string
- func NewJournalInfrastructureLogTemplate() types.JournalLog
- func NewJournalLog(priority int, message, hostname string) string
- func NewKubeAuditLog(eventTime time.Time) string
- func NewOVNAuditLog(eventTime time.Time) string
- func NewPartialCRIOLogMessage(timestamp, message string) string
- func OptionsValue(options []Option, name string, notFound any) any
- func VectorConfFactory(profile configv1.TLSProfileType, options ...Option) string
- type CollectorFramework
- type CollectorFunctionalFramework
- func (f *CollectorFunctionalFramework) AddBenchmarkForwardOutput(b *runtime.PodBuilder, output obs.OutputSpec, image string) error
- func (f *CollectorFunctionalFramework) AddCloudWatchOutput(b *runtime.PodBuilder, spec obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddES7Output(b *runtime.PodBuilder, output obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddFluentdHttpOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddKafkaOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddOTELCollector(b *runtime.PodBuilder, outputName string) error
- func (f *CollectorFunctionalFramework) AddOutputContainersVisitors() []runtime.PodBuilderVisitor
- func (f *CollectorFunctionalFramework) AddSecret(secret *corev1.Secret) *CollectorFunctionalFramework
- func (f *CollectorFunctionalFramework) AddSplunkOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddSyslogOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
- func (f *CollectorFunctionalFramework) AddVectorHttpOutput(b *runtime.PodBuilder, output obs.OutputSpec, options ...Option) error
- func (f *CollectorFunctionalFramework) AddVectorHttpOutputWithConfig(b *runtime.PodBuilder, output obs.OutputSpec, profile configv1.TLSProfileType, ...) error
- func (f *CollectorFunctionalFramework) Cleanup()
- func (f *CollectorFunctionalFramework) Deploy() (err error)
- func (f *CollectorFunctionalFramework) DeployWithVisitor(visitor runtime.PodBuilderVisitor) (err error)
- func (f *CollectorFunctionalFramework) DeployWithVisitors(visitors []runtime.PodBuilderVisitor) (err error)
- func (f *CollectorFunctionalFramework) GetAllCloudwatchGroups() ([]string, error)
- func (f *CollectorFunctionalFramework) GetLogGroupByName(groupName string) ([]string, error)
- func (f *CollectorFunctionalFramework) GetLogGroupByType(inputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) GetLogMessagesByGroupAndStream(groupName string, streamName string) ([]string, error)
- func (f *CollectorFunctionalFramework) GetLogStreamsByGroup(groupName string) ([]string, error)
- func (f *CollectorFunctionalFramework) GetLogsFromCollector() (string, error)
- func (f *CollectorFunctionalFramework) GetLogsFromElasticSearch(outputName string, outputLogType string, options ...Option) (results []string, err error)
- func (f *CollectorFunctionalFramework) GetLogsFromElasticSearchIndex(outputName string, index string, options ...Option) (results []string, err error)
- func (f *CollectorFunctionalFramework) GetMaxReadDuration() time.Duration
- func (f *CollectorFunctionalFramework) LogWriter(filename string) (io.WriteCloser, error)
- func (f *CollectorFunctionalFramework) ReadAppLogsByIndexFromSplunk(namespace, name, index string) (results []string, err error)
- func (f *CollectorFunctionalFramework) ReadApplicationLogsFrom(outputName string) ([]types.ApplicationLog, error)
- func (f *CollectorFunctionalFramework) ReadApplicationLogsFromKafka(topic string, brokerlistener string, consumercontainername string) (results []string, err error)
- func (f *CollectorFunctionalFramework) ReadAuditLogsFrom(outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadCollectorLogs() (string, error)
- func (f *CollectorFunctionalFramework) ReadFileFrom(outputName, filePath string) (result string, err error)
- func (f *CollectorFunctionalFramework) ReadFileFromWithRetryInterval(outputName, filePath string, retryInterval time.Duration) (result string, err error)
- func (f *CollectorFunctionalFramework) ReadInfrastructureLogsFrom(outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadLogsByTypeFromSplunk(namespace, name, logType string) (results []string, err error)
- func (f *CollectorFunctionalFramework) ReadLogsFrom(outputName, sourceType string) (results []string, err error)
- func (f *CollectorFunctionalFramework) ReadLogsFromCloudwatch(inputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadLogsFromCloudwatchByGroupName(groupName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadNApplicationLogsFrom(n uint64, outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadOvnAuditLogsFrom(outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) ReadRawApplicationLogsFrom(outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) Readk8sAuditLogsFrom(outputName string) ([]string, error)
- func (f *CollectorFunctionalFramework) RunCommand(container string, cmd ...string) (string, error)
- func (f *CollectorFunctionalFramework) WaitForPodToBeReady() error
- func (f *CollectorFunctionalFramework) WriteAsJsonToHttpInput(inputName string, v any) error
- func (f *CollectorFunctionalFramework) WriteAuditHostLog(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteK8sAuditLog(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteLog(filename string, data []byte) error
- func (f *CollectorFunctionalFramework) WriteMessagesToApplicationLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToApplicationLogForContainer(msg, container string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToAuditLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToInfraContainerLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToInfraJournalLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToLog(msg string, numOfLogs int, filename string) error
- func (f *CollectorFunctionalFramework) WriteMessagesToNamespace(msg, namespace string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToOAuthAuditLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToOVNAuditLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesToOpenshiftAuditLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesTok8sAuditLog(msg string, numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteMessagesWithNotUTF8SymbolsToLog() error
- func (f *CollectorFunctionalFramework) WriteOVNAuditLog(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteOpenshiftAuditLog(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WriteToHttpInput(inputName, buf string) error
- func (f *CollectorFunctionalFramework) WriteToHttpInputWithPortForwarder(inputName string, buf []byte) error
- func (f *CollectorFunctionalFramework) WritesApplicationLogs(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WritesApplicationLogsWithDelay(numOfLogs int, delay float32) error
- func (f *CollectorFunctionalFramework) WritesInfraContainerLogs(numOfLogs int) error
- func (f *CollectorFunctionalFramework) WritesNApplicationLogsOfSize(numOfLogs, size int, delay float32) error
- type ElasticsearchVersion
- type Option
- type PortForwarder
Constants ¶
const ( OpenshiftAuditLog = "openshift-audit-logs" ApplicationLogFile = "/tmp/app-logs" InfrastructureLogFile = "/tmp/infra.log" FunctionalNodeName = "functional-test-node" ApplicationLogDir = "/var/log/pods" AuditLogDir = "/var/log/audit" OvnAuditLogDir = "/var/log/ovn" OauthAuditLogDir = "/var/log/oauth-apiserver" OpenshiftAuditLogDir = "/var/log/openshift-apiserver" K8sAuditLogDir = "/var/log/kube-apiserver" )
const ( OVNLogTemplate = "%s|00004|acl_log(ovn_pinctrl0)|INFO|name=verify-audit-logging_deny-all, verdict=drop" KubeAuditLogTemplate = `` /* 1457-byte string literal not displayed */ OpenShiftAuditLogTemplate = `` /* 535-byte string literal not displayed */ )
const ( AwsAccessKeyID = "AKIAIOSFODNN7EXAMPLE" AwsSecretAccessKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" //nolint:gosec CloudwatchSecret = "cloudwatch-secret" )
const ( VectorHttpSourceBenchmarkConfTemplate = "" + `[sources.my_source] type = "http_server" address = "127.0.0.1:8090" decoding.codec = "json" framing.method = "newline_delimited" {{ if ne .MinTLS "" }} [sources.my_source.tls] enabled = true {{ if ne .MinTLS "" }} min_tls_version = "{{.MinTLS}}" {{ end }} {{ if ne .Ciphers "" }} ciphersuites = "{{.Ciphers}}" {{ end }} key_file = "/tmp/secrets/http/tls.key" crt_file = "/tmp/secrets/http/tls.crt" {{ end }} [transforms.app_logs] type = "remap" inputs = ["my_source"] source = ''' .epoc_out = to_float(now()) mytime, err = parse_timestamp(."@timestamp", format: "%Y-%m-%dT%H:%M:%S%.fZ") if err != null { mytime, err = parse_timestamp(."@timestamp", format: "%Y-%m-%dT%H:%M:%S%.f%z") if err != null { log("Unable to parse @timestamp: " + err, level: "error") } } .epoc_in = to_float(mytime) ''' [sinks.my_sink] inputs = ["app_logs"] type = "file" path = "{{.Path}}" [sinks.my_sink.encoding] codec = "json" ` VectorHttpSourceConfTemplate = "" + `[sources.my_source] type = "http_server" address = "127.0.0.1:8090" decoding.codec = "json" framing.method = "newline_delimited" {{ .Username }} {{ .Password }} {{ if ne .MinTLS "" }} [sources.my_source.tls] enabled = true {{ if ne .MinTLS "" }} min_tls_version = "{{.MinTLS}}" {{ end }} {{ if ne .Ciphers "" }} ciphersuites = "{{.Ciphers}}" {{ end }} key_file = "/tmp/secrets/http/tls.key" crt_file = "/tmp/secrets/http/tls.crt" {{ end }} [transforms.app_logs] type = "remap" inputs = ["my_source"] source = ''' del(.source_type) del(.timestamp) ''' [sinks.my_sink] inputs = ["app_logs"] type = "file" path = "{{.Path}}" [sinks.my_sink.encoding] codec = "json" except_fields = ["path"] ` FluentdHttpSourceConf = `` /* 350-byte string literal not displayed */ )
const ( // Kafka deployment definitions ImageRemoteKafka = kafka.KafkaImage ImageRemoteKafkaInit = kafka.KafkaInitUtilsImage )
const ( OTELReceiverConf = `` /* 284-byte string literal not displayed */ OTELCollectorImage = "quay.io/openshift-logging/opentelemetry-collector:0.96.0" )
const ( SplunkImage = "quay.io/openshift-logging/splunk:9.0.0" SplunkHecPort = 8088 SplunkIndexName = "fooIndex" SplunkIndexKeyName = "log_type" SplunkDefaultIndex = "main" SplunkStaticDynamicIndex = "foo-application" )
const IncreaseRsyslogMaxMessageSize = "$MaxMessageSize 50000"
Variables ¶
var ( TemplateForAnyPipelineMetadata = types.PipelineMetadata{ Collector: types.Collector{ Ipaddr4: "**optional**", Inputname: "**optional**", Name: "**optional**", Version: "**optional**", ReceivedAt: time.Time{}, }, } TemplateForAnyKubernetes = types.Kubernetes{ ContainerName: "*", ContainerID: "**optional**", PodName: "*", NamespaceName: "*", NamespaceID: "**optional**", ContainerImage: "*", ContainerImageID: "**optional**", PodID: "*", PodIP: "**optional**", Host: "**optional**", MasterURL: "**optional**", FlatLabels: []string{"*"}, NamespaceLabels: map[string]string{"*": "*"}, Annotations: map[string]string{"*": "*"}, ContainerStream: "*", } )
var ( HecToken = rand.Word(16) AdminPassword = rand.Word(16) ConfigTemplate = fmt.Sprintf(` splunk: hec: ssl: false token: "{{ string .Token }}" password: "{{ string .Password }}" idxc_secret: "{{ string .IdxcSecret }}" shc_secret: "{{ string .SHCSecret }}" conf: - key: indexes value: directory: /opt/splunk/etc/system/local/ content: %s: homePath: $SPLUNK_DB/%s/db coldPath: $SPLUNK_DB/%s/colddb thawedPath: $SPLUNK_DB/%s/thaweddb %s: homePath: $SPLUNK_DB/%s/db coldPath: $SPLUNK_DB/%s/colddb thawedPath: $SPLUNK_DB/%s/thaweddb %s: homePath: $SPLUNK_DB/%s/db coldPath: $SPLUNK_DB/%s/colddb thawedPath: $SPLUNK_DB/%s/thaweddb `, SplunkIndexName, SplunkIndexName, SplunkIndexName, SplunkIndexName, string(obs.InputTypeApplication), string(obs.InputTypeApplication), string(obs.InputTypeApplication), string(obs.InputTypeApplication), SplunkStaticDynamicIndex, SplunkStaticDynamicIndex, SplunkStaticDynamicIndex, SplunkStaticDynamicIndex, ) SplunkEndpointHTTP = fmt.Sprintf("http://localhost:%d", SplunkHecPort) )
var TestAPIAdapterConfigVisitor = func(conf string) string { conf = strings.Replace(conf, "@type kubernetes_metadata", "@type kubernetes_metadata\ntest_api_adapter KubernetesMetadata::TestApiAdapter\n", 1) return conf }
Functions ¶
func AddESOutput ¶
func AddESOutput(version ElasticsearchVersion, b *runtime.PodBuilder, output obs.OutputSpec) error
func CreateAppLogFromJson ¶
func GenerateConfigmapData ¶
func NewApplicationLogTemplate ¶
func NewApplicationLogTemplate() types.ApplicationLog
func NewAuditHostLog ¶
func NewCRIOLogMessage ¶
func NewContainerInfrastructureLogTemplate ¶
func NewContainerInfrastructureLogTemplate() types.ApplicationLog
NewContainerInfrastructureLogTemplate creates a generally expected template for infrastructure container logs
func NewFullCRIOLogMessage ¶
func NewJournalInfrastructureLogTemplate ¶
func NewJournalInfrastructureLogTemplate() types.JournalLog
NewJournalInfrastructureLogTemplate creates a generally expected template for infrastructure journal logs
func NewJournalLog ¶
func NewKubeAuditLog ¶
func NewOVNAuditLog ¶
func OptionsValue ¶
OptionsValue returns the value if found or the default
func VectorConfFactory ¶
func VectorConfFactory(profile configv1.TLSProfileType, options ...Option) string
Types ¶
type CollectorFramework ¶
type CollectorFunctionalFramework ¶
type CollectorFunctionalFramework struct { Name string Namespace string Conf string Labels map[string]string Forwarder *obs.ClusterLogForwarder Test *client.Test Pod *corev1.Pod //Secrets associated with outputs to mount into the collector podspec Secrets []*corev1.Secret //VisitConfig allows the Framework to modify the config after generating from logforwardering VisitConfig func(string) string //MaxReadDuration is the max duration to wait to read logs from the receiver MaxReadDuration *time.Duration // contains filtered or unexported fields }
CollectorFunctionalFramework deploys stand alone fluentd with the fluent.conf as generated by input ClusterLogForwarder CR
func NewCollectorFunctionalFramework ¶
func NewCollectorFunctionalFramework(testOptions ...client.TestOption) *CollectorFunctionalFramework
func NewCollectorFunctionalFrameworkUsing ¶
func NewCollectorFunctionalFrameworkUsing(t *client.Test, fnClose func(), verbosity int) *CollectorFunctionalFramework
func (*CollectorFunctionalFramework) AddBenchmarkForwardOutput ¶
func (f *CollectorFunctionalFramework) AddBenchmarkForwardOutput(b *runtime.PodBuilder, output obs.OutputSpec, image string) error
func (*CollectorFunctionalFramework) AddCloudWatchOutput ¶
func (f *CollectorFunctionalFramework) AddCloudWatchOutput(b *runtime.PodBuilder, spec obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddES7Output ¶
func (f *CollectorFunctionalFramework) AddES7Output(b *runtime.PodBuilder, output obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddFluentdHttpOutput ¶
func (f *CollectorFunctionalFramework) AddFluentdHttpOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddKafkaOutput ¶
func (f *CollectorFunctionalFramework) AddKafkaOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddOTELCollector ¶
func (f *CollectorFunctionalFramework) AddOTELCollector(b *runtime.PodBuilder, outputName string) error
TODO: refactor
func (*CollectorFunctionalFramework) AddOutputContainersVisitors ¶
func (f *CollectorFunctionalFramework) AddOutputContainersVisitors() []runtime.PodBuilderVisitor
func (*CollectorFunctionalFramework) AddSecret ¶
func (f *CollectorFunctionalFramework) AddSecret(secret *corev1.Secret) *CollectorFunctionalFramework
AddSecret to the framework to be created when Deploy is called
func (*CollectorFunctionalFramework) AddSplunkOutput ¶
func (f *CollectorFunctionalFramework) AddSplunkOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddSyslogOutput ¶
func (f *CollectorFunctionalFramework) AddSyslogOutput(b *runtime.PodBuilder, output obs.OutputSpec) error
func (*CollectorFunctionalFramework) AddVectorHttpOutput ¶
func (f *CollectorFunctionalFramework) AddVectorHttpOutput(b *runtime.PodBuilder, output obs.OutputSpec, options ...Option) error
func (*CollectorFunctionalFramework) AddVectorHttpOutputWithConfig ¶
func (f *CollectorFunctionalFramework) AddVectorHttpOutputWithConfig(b *runtime.PodBuilder, output obs.OutputSpec, profile configv1.TLSProfileType, secret *corev1.Secret, options ...Option) error
func (*CollectorFunctionalFramework) Cleanup ¶
func (f *CollectorFunctionalFramework) Cleanup()
func (*CollectorFunctionalFramework) Deploy ¶
func (f *CollectorFunctionalFramework) Deploy() (err error)
Deploy the objects needed to functional Test
func (*CollectorFunctionalFramework) DeployWithVisitor ¶
func (f *CollectorFunctionalFramework) DeployWithVisitor(visitor runtime.PodBuilderVisitor) (err error)
func (*CollectorFunctionalFramework) DeployWithVisitors ¶
func (f *CollectorFunctionalFramework) DeployWithVisitors(visitors []runtime.PodBuilderVisitor) (err error)
Deploy the objects needed to functional Test
func (*CollectorFunctionalFramework) GetAllCloudwatchGroups ¶
func (f *CollectorFunctionalFramework) GetAllCloudwatchGroups() ([]string, error)
func (*CollectorFunctionalFramework) GetLogGroupByName ¶
func (f *CollectorFunctionalFramework) GetLogGroupByName(groupName string) ([]string, error)
func (*CollectorFunctionalFramework) GetLogGroupByType ¶
func (f *CollectorFunctionalFramework) GetLogGroupByType(inputName string) ([]string, error)
func (*CollectorFunctionalFramework) GetLogMessagesByGroupAndStream ¶
func (f *CollectorFunctionalFramework) GetLogMessagesByGroupAndStream(groupName string, streamName string) ([]string, error)
func (*CollectorFunctionalFramework) GetLogStreamsByGroup ¶
func (f *CollectorFunctionalFramework) GetLogStreamsByGroup(groupName string) ([]string, error)
func (*CollectorFunctionalFramework) GetLogsFromCollector ¶
func (f *CollectorFunctionalFramework) GetLogsFromCollector() (string, error)
func (*CollectorFunctionalFramework) GetLogsFromElasticSearch ¶
func (*CollectorFunctionalFramework) GetLogsFromElasticSearchIndex ¶
func (*CollectorFunctionalFramework) GetMaxReadDuration ¶
func (f *CollectorFunctionalFramework) GetMaxReadDuration() time.Duration
func (*CollectorFunctionalFramework) LogWriter ¶
func (f *CollectorFunctionalFramework) LogWriter(filename string) (io.WriteCloser, error)
LogWriter returns an io.WriteCloser that appends to a log file on the collector Pod. Call Close() when finished to terminate the writer process.
func (*CollectorFunctionalFramework) ReadAppLogsByIndexFromSplunk ¶
func (f *CollectorFunctionalFramework) ReadAppLogsByIndexFromSplunk(namespace, name, index string) (results []string, err error)
func (*CollectorFunctionalFramework) ReadApplicationLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadApplicationLogsFrom(outputName string) ([]types.ApplicationLog, error)
func (*CollectorFunctionalFramework) ReadApplicationLogsFromKafka ¶
func (*CollectorFunctionalFramework) ReadAuditLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadAuditLogsFrom(outputName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadCollectorLogs ¶
func (f *CollectorFunctionalFramework) ReadCollectorLogs() (string, error)
func (*CollectorFunctionalFramework) ReadFileFrom ¶
func (f *CollectorFunctionalFramework) ReadFileFrom(outputName, filePath string) (result string, err error)
func (*CollectorFunctionalFramework) ReadFileFromWithRetryInterval ¶
func (*CollectorFunctionalFramework) ReadInfrastructureLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadInfrastructureLogsFrom(outputName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadLogsByTypeFromSplunk ¶
func (f *CollectorFunctionalFramework) ReadLogsByTypeFromSplunk(namespace, name, logType string) (results []string, err error)
func (*CollectorFunctionalFramework) ReadLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadLogsFrom(outputName, sourceType string) (results []string, err error)
func (*CollectorFunctionalFramework) ReadLogsFromCloudwatch ¶
func (f *CollectorFunctionalFramework) ReadLogsFromCloudwatch(inputName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadLogsFromCloudwatchByGroupName ¶
func (f *CollectorFunctionalFramework) ReadLogsFromCloudwatchByGroupName(groupName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadNApplicationLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadNApplicationLogsFrom(n uint64, outputName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadOvnAuditLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadOvnAuditLogsFrom(outputName string) ([]string, error)
func (*CollectorFunctionalFramework) ReadRawApplicationLogsFrom ¶
func (f *CollectorFunctionalFramework) ReadRawApplicationLogsFrom(outputName string) ([]string, error)
func (*CollectorFunctionalFramework) Readk8sAuditLogsFrom ¶
func (f *CollectorFunctionalFramework) Readk8sAuditLogsFrom(outputName string) ([]string, error)
func (*CollectorFunctionalFramework) RunCommand ¶
func (f *CollectorFunctionalFramework) RunCommand(container string, cmd ...string) (string, error)
func (*CollectorFunctionalFramework) WaitForPodToBeReady ¶
func (f *CollectorFunctionalFramework) WaitForPodToBeReady() error
func (*CollectorFunctionalFramework) WriteAsJsonToHttpInput ¶
func (f *CollectorFunctionalFramework) WriteAsJsonToHttpInput(inputName string, v any) error
func (*CollectorFunctionalFramework) WriteAuditHostLog ¶
func (f *CollectorFunctionalFramework) WriteAuditHostLog(numOfLogs int) error
func (*CollectorFunctionalFramework) WriteK8sAuditLog ¶
func (f *CollectorFunctionalFramework) WriteK8sAuditLog(numOfLogs int) error
func (*CollectorFunctionalFramework) WriteLog ¶
func (f *CollectorFunctionalFramework) WriteLog(filename string, data []byte) error
WriteLog writes bytes to a log file on the collector Pod.
func (*CollectorFunctionalFramework) WriteMessagesToApplicationLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToApplicationLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToApplicationLogForContainer ¶
func (f *CollectorFunctionalFramework) WriteMessagesToApplicationLogForContainer(msg, container string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToAuditLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToAuditLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToInfraContainerLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToInfraContainerLog(msg string, numOfLogs int) error
WriteMessagesInfraContainerLog mocks writing infra container logs for the functional Framework. This may require enabling the mock api adapter to get metadata for infrastructure logs since the path does not match a pod running on the cluster (e.g Framework.VisitConfig = functional.TestAPIAdapterConfigVisitor)
func (*CollectorFunctionalFramework) WriteMessagesToInfraJournalLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToInfraJournalLog(msg string, numOfLogs int) error
WriteMessagesToInfraJournalLog mocks writing infra journal log. The framework assumes the msg is formatted as a JSON entry already parsed like the systemd plugin. Ex: {"PRIORITY":"6","_UID":"1000","_GID":"1000","_CAP_EFFECTIVE":"0","_SELINUX_CONTEXT":"unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023","_AUDIT_SESSION":"3","_AUDIT_LOGINUID":"1000","_SYSTEMD_OWNER_UID":"1000","_SYSTEMD_UNIT":"user@1000.service","_SYSTEMD_SLICE":"user-1000.slice","_MACHINE_ID":"e2a074cafa5044c7a2761b4a97e249ce","_HOSTNAME":"decker","_TRANSPORT":"stdout","_SYSTEMD_USER_SLICE":"app.slice","SYSLOG_IDENTIFIER":"google-chrome.desktop","_COMM":"cat","_EXE":"/usr/bin/cat","_CMDLINE":"cat","MESSAGE":"Error in cpuinfo: failed to parse processor information from /proc/cpuinfo","_BOOT_ID":"40646b056fbe4af6a8b9543864ae0216","_STREAM_ID":"063bc071ac204a37aabc926f2f7614b0","_PID":"3194","_SYSTEMD_CGROUP":"/user.slice/user-1000.slice/user@1000.service/app.slice/app-glib-google\\x2dchrome-3188.scope/3194","_SYSTEMD_USER_UNIT":"app-glib-google\\x2dchrome-3188.scope","_SYSTEMD_INVOCATION_ID":"764ffdafa8b34ac69ec6055d5f942583"}
func (*CollectorFunctionalFramework) WriteMessagesToLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToLog(msg string, numOfLogs int, filename string) error
func (*CollectorFunctionalFramework) WriteMessagesToNamespace ¶
func (f *CollectorFunctionalFramework) WriteMessagesToNamespace(msg, namespace string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToOAuthAuditLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToOAuthAuditLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToOVNAuditLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToOVNAuditLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesToOpenshiftAuditLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesToOpenshiftAuditLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesTok8sAuditLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesTok8sAuditLog(msg string, numOfLogs int) error
func (*CollectorFunctionalFramework) WriteMessagesWithNotUTF8SymbolsToLog ¶
func (f *CollectorFunctionalFramework) WriteMessagesWithNotUTF8SymbolsToLog() error
WriteMessagesWithNotUTF8SymbolsToLog write 12 symbols in ISO-8859-1 encoding need to use small hack with 'sed' replacement because if try to use something like: 'echo -e \xC0\xC1' Go always convert every undecodeable byte into '\ufffd'. More details here: https://github.com/golang/go/issues/38006
func (*CollectorFunctionalFramework) WriteOVNAuditLog ¶
func (f *CollectorFunctionalFramework) WriteOVNAuditLog(numOfLogs int) error
func (*CollectorFunctionalFramework) WriteOpenshiftAuditLog ¶
func (f *CollectorFunctionalFramework) WriteOpenshiftAuditLog(numOfLogs int) error
func (*CollectorFunctionalFramework) WriteToHttpInput ¶
func (f *CollectorFunctionalFramework) WriteToHttpInput(inputName, buf string) error
func (*CollectorFunctionalFramework) WriteToHttpInputWithPortForwarder ¶
func (f *CollectorFunctionalFramework) WriteToHttpInputWithPortForwarder(inputName string, buf []byte) error
func (*CollectorFunctionalFramework) WritesApplicationLogs ¶
func (f *CollectorFunctionalFramework) WritesApplicationLogs(numOfLogs int) error
func (*CollectorFunctionalFramework) WritesApplicationLogsWithDelay ¶
func (f *CollectorFunctionalFramework) WritesApplicationLogsWithDelay(numOfLogs int, delay float32) error
func (*CollectorFunctionalFramework) WritesInfraContainerLogs ¶
func (f *CollectorFunctionalFramework) WritesInfraContainerLogs(numOfLogs int) error
func (*CollectorFunctionalFramework) WritesNApplicationLogsOfSize ¶
func (f *CollectorFunctionalFramework) WritesNApplicationLogsOfSize(numOfLogs, size int, delay float32) error
type ElasticsearchVersion ¶
type ElasticsearchVersion int
const ( ElasticsearchVersion6 ElasticsearchVersion = 6 ElasticsearchVersion7 ElasticsearchVersion = 7 ElasticsearchVersion8 ElasticsearchVersion = 8 )
type PortForwarder ¶
type PortForwarder struct {
// contains filtered or unexported fields
}