Documentation
¶
Index ¶
- func MakeClusterRole(manifestPath string) (*v1.ClusterRole, error)
- func MakeClusterRoleBinding(manifestPath string) (*v1.ClusterRoleBinding, error)
- func MakeDeployment(manifestPath string) (*appsv1.Deployment, error)
- func MakeServiceAccount(manifestPath string) (*v1.ServiceAccount, error)
- func NewBasicEvent() *v1.Event
- type AssertEventsTotalFunc
- type Framework
- func (f *Framework) AssertEventsTotalAbsent(t *testing.T, exporter *KubeEventsExporter, event *v1.Event, count float64)
- func (f *Framework) AssertEventsTotalPresent(t *testing.T, exporter *KubeEventsExporter, event *v1.Event, count float64)
- func (f *Framework) CreateBasicEvent(t *testing.T) *v1.Event
- func (f *Framework) CreateClusterRole(t *testing.T, cr *v1.ClusterRole) *v1.ClusterRole
- func (f *Framework) CreateClusterRoleBinding(t *testing.T, crb *v1.ClusterRoleBinding) *v1.ClusterRoleBinding
- func (f *Framework) CreateDeployment(t *testing.T, deployment *appsv1.Deployment, ns string) *appsv1.Deployment
- func (f *Framework) CreateEvent(t *testing.T, event *v1.Event, ns string) *v1.Event
- func (f *Framework) CreateKubeEventsExporter(t *testing.T) *KubeEventsExporter
- func (f *Framework) CreateService(t *testing.T, service *v1.Service, ns string) *v1.Service
- func (f *Framework) CreateServiceAccount(t *testing.T, sa *v1.ServiceAccount, ns string) *v1.ServiceAccount
- func (f *Framework) DeleteClusterRole(name string) error
- func (f *Framework) DeleteClusterRoleBinding(name string) error
- func (f *Framework) DeleteDeployment(ns, name string) error
- func (f *Framework) DeleteEvent(ns, name string) error
- func (f *Framework) DeleteService(ns, name string) error
- func (f *Framework) DeleteServiceAccount(ns, name string) error
- func (f *Framework) NewEventsEventRecorder(stopCh <-chan struct{}) events.EventRecorder
- func (f *Framework) NewRecordEventRecorder() record.EventRecorder
- func (f *Framework) PollMetric(getter metricFamiliesGetter, name string, expectedMetric *dto.Metric) error
- func (f *Framework) UpdateEvent(event *v1.Event, ns string) (*v1.Event, error)
- type KubeEventsExporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeClusterRole ¶
func MakeClusterRole(manifestPath string) (*v1.ClusterRole, error)
MakeClusterRole creates a cluster role object from yaml manifest.
func MakeClusterRoleBinding ¶
func MakeClusterRoleBinding(manifestPath string) (*v1.ClusterRoleBinding, error)
MakeClusterRoleBinding creates a cluster role binding object from yaml manifest.
func MakeDeployment ¶
func MakeDeployment(manifestPath string) (*appsv1.Deployment, error)
MakeDeployment creates a deployment object from yaml manifest.
func MakeServiceAccount ¶
func MakeServiceAccount(manifestPath string) (*v1.ServiceAccount, error)
MakeServiceAccount creates a service account object from yaml manifest.
func NewBasicEvent ¶
NewBasicEvent constructs a basic Event for test purposes.
Types ¶
type AssertEventsTotalFunc ¶
type AssertEventsTotalFunc func(t *testing.T, exporter *KubeEventsExporter, event *v1.Event, count float64)
AssertEventsTotalFunc is a function that assert kube_events_total metrics.
type Framework ¶
type Framework struct { KubeClient kubernetes.Interface DefaultTimeout time.Duration ExporterImage string ExporterArgs []string }
Framework contains global information needed by the framework helper functions.
func NewFramework ¶
NewFramework returns a new framework.
func (*Framework) AssertEventsTotalAbsent ¶
func (f *Framework) AssertEventsTotalAbsent(t *testing.T, exporter *KubeEventsExporter, event *v1.Event, count float64)
AssertEventsTotalAbsent asserts that the kube_events_total metric related to the given event and count is absent on the exporter.
func (*Framework) AssertEventsTotalPresent ¶
func (f *Framework) AssertEventsTotalPresent(t *testing.T, exporter *KubeEventsExporter, event *v1.Event, count float64)
AssertEventsTotalPresent asserts that the kube_events_total metric related to the given event and count is present on the exporter.
func (*Framework) CreateBasicEvent ¶
CreateBasicEvent creates a basic Event.
func (*Framework) CreateClusterRole ¶
func (f *Framework) CreateClusterRole(t *testing.T, cr *v1.ClusterRole) *v1.ClusterRole
CreateClusterRole creates the given cluster role.
func (*Framework) CreateClusterRoleBinding ¶
func (f *Framework) CreateClusterRoleBinding(t *testing.T, crb *v1.ClusterRoleBinding) *v1.ClusterRoleBinding
CreateClusterRoleBinding creates the given cluster role binding.
func (*Framework) CreateDeployment ¶
func (f *Framework) CreateDeployment(t *testing.T, deployment *appsv1.Deployment, ns string) *appsv1.Deployment
CreateDeployment creates the given deployment.
func (*Framework) CreateEvent ¶
CreateEvent creates the given Event.
func (*Framework) CreateKubeEventsExporter ¶
func (f *Framework) CreateKubeEventsExporter(t *testing.T) *KubeEventsExporter
CreateKubeEventsExporter creates kube-events-exporter deployment inside of the specified namespace.
func (*Framework) CreateService ¶
CreateService creates the given service.
func (*Framework) CreateServiceAccount ¶
func (f *Framework) CreateServiceAccount(t *testing.T, sa *v1.ServiceAccount, ns string) *v1.ServiceAccount
CreateServiceAccount creates the given service account.
func (*Framework) DeleteClusterRole ¶
DeleteClusterRole deletes the given cluster role.
func (*Framework) DeleteClusterRoleBinding ¶
DeleteClusterRoleBinding deletes the given cluster role binding.
func (*Framework) DeleteDeployment ¶
DeleteDeployment deletes the given deployment.
func (*Framework) DeleteEvent ¶
DeleteEvent deletes the given Event.
func (*Framework) DeleteService ¶
DeleteService deletes the given service.
func (*Framework) DeleteServiceAccount ¶
DeleteServiceAccount deletes the given service account.
func (*Framework) NewEventsEventRecorder ¶
func (f *Framework) NewEventsEventRecorder(stopCh <-chan struct{}) events.EventRecorder
NewEventsEventRecorder constructs an events.EventRecorder.
func (*Framework) NewRecordEventRecorder ¶
func (f *Framework) NewRecordEventRecorder() record.EventRecorder
NewRecordEventRecorder constructs a record.EventRecorder.
type KubeEventsExporter ¶
type KubeEventsExporter struct { EventServerURL string ExporterServerURL string // contains filtered or unexported fields }
KubeEventsExporter exposes information needed by the framework to interact with kube-events-exporter.
func (*KubeEventsExporter) GetEventMetricFamilies ¶
func (e *KubeEventsExporter) GetEventMetricFamilies() (map[string]*dto.MetricFamily, error)
GetEventMetricFamilies gets metrics from the event server metrics endpoint and converts them to Prometheus MetricFamily.
func (*KubeEventsExporter) GetExporterMetricFamilies ¶
func (e *KubeEventsExporter) GetExporterMetricFamilies() (map[string]*dto.MetricFamily, error)
GetExporterMetricFamilies gets metrics from the exporter server metrics endpoint and converts them to Prometheus MetricFamily.