Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabelsToNamespace(kubeClient kubernetes.Interface, name string, ...) error
- func CreateClusterRole(kubeClient kubernetes.Interface, relativePath string) (*rbacv1.ClusterRole, error)
- func CreateClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
- func CreateDeployment(kubeClient kubernetes.Interface, namespace string, d *appsv1.Deployment) error
- func CreateIngress(kubeClient kubernetes.Interface, namespace string, i *v1beta1.Ingress) error
- func CreateMutatingHook(kubeClient kubernetes.Interface, certBytes []byte, namespace, yamlPath string) (finalizerFn, error)
- func CreateNamespace(kubeClient kubernetes.Interface, name string) (*v1.Namespace, error)
- func CreateRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
- func CreateSecretWithCert(kubeClient kubernetes.Interface, certBytes, keyBytes []byte, ns, name string) error
- func CreateServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) (finalizerFn, error)
- func CreateServiceAndWaitUntilReady(kubeClient kubernetes.Interface, namespace string, service *v1.Service) (finalizerFn, error)
- func CreateValidatingHook(kubeClient kubernetes.Interface, certBytes []byte, namespace, yamlPath string) (finalizerFn, error)
- func DeleteClusterRole(kubeClient kubernetes.Interface, relativePath string) error
- func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
- func DeleteDeployment(kubeClient kubernetes.Interface, namespace, name string) error
- func DeleteMutatingWebhook(kubeClient kubernetes.Interface, name string) error
- func DeleteNamespace(kubeClient kubernetes.Interface, name string) error
- func DeleteNginxIngressControllerIncDefaultBackend(kubeClient kubernetes.Interface, namespace string) error
- func DeleteRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
- func DeleteServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) error
- func DeleteServiceAndWaitUntilGone(kubeClient kubernetes.Interface, namespace string, serviceName string) error
- func DeleteValidatingWebhook(kubeClient kubernetes.Interface, name string) error
- func GetDeployment(kubeCilent kubernetes.Interface, ns, name string) (*appsv1.Deployment, error)
- func GetIngressIP(kubeClient kubernetes.Interface, namespace string, ingressName string) (*string, error)
- func GetLogs(kubeClient kubernetes.Interface, namespace string, ...) (string, error)
- func MakeBasicIngress(serviceName string, servicePort int) *v1beta1.Ingress
- func MakeConfigMapWithCert(kubeClient kubernetes.Interface, ns, name, keyKey, certKey, caKey string, ...) *v1.ConfigMap
- func MakeDeployment(pathToYaml string) (*appsv1.Deployment, error)
- func MakeSecretWithCert(kubeClient kubernetes.Interface, ns, name string, keyList []string, ...) *corev1.Secret
- func MakeService(pathToYaml string) (*v1.Service, error)
- func PathToOSFile(relativPath string) (*os.File, error)
- func ProxyGetPod(kubeClient kubernetes.Interface, namespace, podName, path string) *rest.Request
- func ProxyPostPod(kubeClient kubernetes.Interface, namespace, podName, path, body string) *rest.Request
- func SetupNginxIngressControllerIncDefaultBackend(kubeClient kubernetes.Interface, namespace string) error
- func UpdateClusterRole(kubeClient kubernetes.Interface, clusterRole *rbacv1.ClusterRole) error
- func UpdateDeployment(kubeCilent kubernetes.Interface, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func WaitForCRDReady(listFunc func(opts metav1.ListOptions) (runtime.Object, error)) error
- func WaitForHTTPSuccessStatusCode(timeout time.Duration, url string) error
- func WaitForPodsReady(kubeClient kubernetes.Interface, namespace string, timeout time.Duration, ...) error
- func WaitForPodsRunImage(kubeClient kubernetes.Interface, namespace string, expectedReplicas int, ...) error
- func WaitForServiceReady(kubeClient kubernetes.Interface, namespace string, serviceName string) error
- func WaitUntilDeploymentGone(kubeClient kubernetes.Interface, namespace, name string, timeout time.Duration) error
- type Cert
- type Framework
- func (f *Framework) AddAlertingToPrometheus(p *monitoringv1.Prometheus, ns, name string)
- func (f *Framework) AddRemoteWriteWithTLSToPrometheus(p *monitoringv1.Prometheus, url string, prwtc PromRemoteWriteTestConfig)
- func (f *Framework) AlertmanagerConfigSecret(ns, name string) (*v1.Secret, error)
- func (f *Framework) CheckPrometheusFiringAlert(ns, svcName, alertName string) (bool, error)
- func (f *Framework) CreateAlertmanagerAndWaitUntilReady(ns string, a *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
- func (f *Framework) CreateBlackBoxExporterAndWaitUntilReady(ns, name string) error
- func (f *Framework) CreateCRD(crd *v1.CustomResourceDefinition) error
- func (f *Framework) CreateCRDAndWaitUntilReady(crdName string, listFunc func(opts metav1.ListOptions) (runtime.Object, error)) error
- func (f *Framework) CreatePrometheusAndWaitUntilReady(ns string, p *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
- func (f *Framework) CreatePrometheusOperator(ns, opImage string, ...) ([]finalizerFn, error)
- func (f *Framework) CreateRule(ns string, ar *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
- func (f *Framework) CreateSilence(ns, n string) (string, error)
- func (f *Framework) CreateThanosRulerAndWaitUntilReady(ns string, tr *monitoringv1.ThanosRuler) (*monitoringv1.ThanosRuler, error)
- func (f *Framework) DeleteAlertmanagerAndWaitUntilGone(ns, name string) error
- func (f *Framework) DeletePrometheusAndWaitUntilGone(ns, name string) error
- func (f *Framework) DeleteRule(ns string, r string) error
- func (f *Framework) DeleteThanosRulerAndWaitUntilGone(ns, name string) error
- func (f *Framework) GetActiveTargets(ns, svcName string) ([]*Target, error)
- func (f *Framework) GetAlertmanagerMetrics(ns, n string) (textparse.Parser, error)
- func (f *Framework) GetAlertmanagerStatus(ns, n string) (amAPIStatusResp, error)
- func (f *Framework) GetCRD(name string) (*v1.CustomResourceDefinition, error)
- func (f *Framework) GetHealthyTargets(ns, svcName string) ([]*Target, error)
- func (f *Framework) GetPodRestartCount(ns, podName string) (map[string]int32, error)
- func (f *Framework) GetRule(ns, name string) (*monitoringv1.PrometheusRule, error)
- func (f *Framework) GetSilences(ns, n string) ([]amAPISil, error)
- func (f *Framework) ListCRDs() (*v1.CustomResourceDefinitionList, error)
- func (f *Framework) MakeAlertmanagerService(name, group string, serviceType v1.ServiceType) *v1.Service
- func (f *Framework) MakeAndCreateFiringRule(ns, name, alertName string) (*monitoringv1.PrometheusRule, error)
- func (f *Framework) MakeAndCreateInvalidRule(ns, name, alertName string) (*monitoringv1.PrometheusRule, error)
- func (f *Framework) MakeBasicAlertmanager(name string, replicas int32) *monitoringv1.Alertmanager
- func (f *Framework) MakeBasicPrometheus(ns, name, group string, replicas int32) *monitoringv1.Prometheus
- func (f *Framework) MakeBasicRule(ns, name string, groups []monitoringv1.RuleGroup) *monitoringv1.PrometheusRule
- func (f *Framework) MakeBasicServiceMonitor(name string) *monitoringv1.ServiceMonitor
- func (f *Framework) MakeBasicStaticProbe(name, url string, targets []string) *monitoringv1.Probe
- func (f *Framework) MakeBasicThanosRuler(name string, replicas int32) *monitoringv1.ThanosRuler
- func (f *Framework) MakeBlackBoxExporterService(ns, name string) *v1.Service
- func (f *Framework) MakeCRD(pathToYaml string) (*v1.CustomResourceDefinition, error)
- func (f *Framework) MakeEchoDeployment(group string) *appsv1.Deployment
- func (f *Framework) MakeEchoService(name, group string, serviceType v1.ServiceType) *v1.Service
- func (f *Framework) MakePrometheusService(name, group string, serviceType v1.ServiceType) *v1.Service
- func (f *Framework) MakeThanosQuerierService(name string) *v1.Service
- func (f *Framework) NewTestCtx(t *testing.T) TestCtx
- func (f *Framework) Poll(timeout, pollInterval time.Duration, pollFunc func() (bool, error)) error
- func (f *Framework) PrintEvents() error
- func (f *Framework) PrintPodLogs(ns, p string) error
- func (f *Framework) PrometheusSVCGetRequest(ns, svcName, endpoint string, query map[string]string) ([]byte, error)
- func (f *Framework) SecretFromYaml(filepath string) (*v1.Secret, error)
- func (f *Framework) SendAlertToAlertmanager(ns, n string, start time.Time) error
- func (f *Framework) UpdateAlertmanagerAndWaitUntilReady(ns string, a *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
- func (f *Framework) UpdatePrometheusAndWaitUntilReady(ns string, p *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
- func (f *Framework) UpdateRule(ns string, ar *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
- func (f *Framework) UpdateThanosRulerAndWaitUntilReady(ns string, tr *monitoringv1.ThanosRuler) (*monitoringv1.ThanosRuler, error)
- func (f *Framework) WaitForActiveTargets(ns, svcName string, amount int) error
- func (f *Framework) WaitForAlertmanagerConfigToBeReloaded(ns, amName string, previousReloadTimestamp time.Time) error
- func (f *Framework) WaitForAlertmanagerConfigToContainString(ns, amName, expectedString string) error
- func (f *Framework) WaitForAlertmanagerInitialized(ns, name string, amountPeers int) error
- func (f *Framework) WaitForAlertmanagerReady(ns, name string, replicas int) error
- func (f *Framework) WaitForConfigMapExist(ns, name string) (*v1.ConfigMap, error)
- func (f *Framework) WaitForConfigMapNotExist(ns, name string) error
- func (f *Framework) WaitForDiscoveryWorking(ns, svcName, prometheusName string) error
- func (f *Framework) WaitForHealthyTargets(ns, svcName string, amount int) error
- func (f *Framework) WaitForPrometheusFiringAlert(ns, svcName, alertName string) error
- func (f *Framework) WaitForPrometheusReady(p *monitoringv1.Prometheus, timeout time.Duration) error
- func (f *Framework) WaitForPrometheusRunImageAndReady(ns string, p *monitoringv1.Prometheus) error
- func (f *Framework) WaitForRule(ns, name string) error
- func (f *Framework) WaitForThanosRulerReady(tr *monitoringv1.ThanosRuler, timeout time.Duration) error
- type Key
- type PromRemoteWriteTestConfig
- type PrometheusQueryAPIResponse
- type PrometheusQueryData
- type PrometheusQueryResult
- type Target
- type TestCtx
- func (ctx *TestCtx) AddFinalizerFn(fn finalizerFn)
- func (ctx *TestCtx) Cleanup(t *testing.T)
- func (ctx *TestCtx) CreateNamespace(t *testing.T, kubeClient kubernetes.Interface) string
- func (ctx *TestCtx) GetObjID() string
- func (ctx *TestCtx) SetupPrometheusRBAC(t *testing.T, ns string, kubeClient kubernetes.Interface)
- func (ctx *TestCtx) SetupPrometheusRBACGlobal(t *testing.T, ns string, kubeClient kubernetes.Interface)
Constants ¶
const ( SECRET = 0 CONFIGMAP = 1 )
Variables ¶
var ( CRDCreateRule = rbacv1.PolicyRule{ APIGroups: []string{"apiextensions.k8s.io"}, Resources: []string{"customresourcedefinitions"}, Verbs: []string{"create"}, } CRDMonitoringRule = rbacv1.PolicyRule{ APIGroups: []string{"apiextensions.k8s.io"}, Resources: []string{"customresourcedefinitions"}, ResourceNames: []string{ "alertmanagers.monitoring.coreos.com", "podmonitors.monitoring.coreos.com", "probes.monitoring.coreos.com", "prometheuses.monitoring.coreos.com", "prometheusrules.monitoring.coreos.com", "servicemonitors.monitoring.coreos.com", "thanosrulers.monitoring.coreos.com", }, Verbs: []string{"get", "update"}, } )
var ValidAlertmanagerConfig = `` /* 229-byte string literal not displayed */
Functions ¶
func AddLabelsToNamespace ¶ added in v0.19.0
func CreateClusterRole ¶
func CreateClusterRole(kubeClient kubernetes.Interface, relativePath string) (*rbacv1.ClusterRole, error)
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
func CreateDeployment ¶
func CreateDeployment(kubeClient kubernetes.Interface, namespace string, d *appsv1.Deployment) error
func CreateIngress ¶
func CreateMutatingHook ¶ added in v0.31.0
func CreateMutatingHook(kubeClient kubernetes.Interface, certBytes []byte, namespace, yamlPath string) (finalizerFn, error)
func CreateNamespace ¶
func CreateRoleBinding ¶
func CreateRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) (finalizerFn, error)
func CreateSecretWithCert ¶ added in v0.31.0
func CreateSecretWithCert(kubeClient kubernetes.Interface, certBytes, keyBytes []byte, ns, name string) error
func CreateServiceAccount ¶
func CreateServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) (finalizerFn, error)
func CreateValidatingHook ¶ added in v0.31.0
func CreateValidatingHook(kubeClient kubernetes.Interface, certBytes []byte, namespace, yamlPath string) (finalizerFn, error)
func DeleteClusterRole ¶
func DeleteClusterRole(kubeClient kubernetes.Interface, relativePath string) error
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
func DeleteDeployment ¶
func DeleteDeployment(kubeClient kubernetes.Interface, namespace, name string) error
func DeleteMutatingWebhook ¶ added in v0.31.0
func DeleteMutatingWebhook(kubeClient kubernetes.Interface, name string) error
func DeleteNamespace ¶
func DeleteNamespace(kubeClient kubernetes.Interface, name string) error
func DeleteNginxIngressControllerIncDefaultBackend ¶
func DeleteNginxIngressControllerIncDefaultBackend(kubeClient kubernetes.Interface, namespace string) error
func DeleteRoleBinding ¶
func DeleteRoleBinding(kubeClient kubernetes.Interface, ns string, relativePath string) error
func DeleteServiceAccount ¶
func DeleteServiceAccount(kubeClient kubernetes.Interface, namespace string, relativPath string) error
func DeleteServiceAndWaitUntilGone ¶
func DeleteServiceAndWaitUntilGone(kubeClient kubernetes.Interface, namespace string, serviceName string) error
func DeleteValidatingWebhook ¶ added in v0.31.0
func DeleteValidatingWebhook(kubeClient kubernetes.Interface, name string) error
func GetDeployment ¶ added in v0.31.0
func GetDeployment(kubeCilent kubernetes.Interface, ns, name string) (*appsv1.Deployment, error)
func GetIngressIP ¶
func MakeConfigMapWithCert ¶ added in v0.41.0
func MakeDeployment ¶
func MakeDeployment(pathToYaml string) (*appsv1.Deployment, error)
func MakeSecretWithCert ¶ added in v0.41.0
func ProxyGetPod ¶
func ProxyGetPod(kubeClient kubernetes.Interface, namespace, podName, path string) *rest.Request
func ProxyPostPod ¶ added in v0.18.1
func ProxyPostPod(kubeClient kubernetes.Interface, namespace, podName, path, body string) *rest.Request
func SetupNginxIngressControllerIncDefaultBackend ¶
func SetupNginxIngressControllerIncDefaultBackend(kubeClient kubernetes.Interface, namespace string) error
func UpdateClusterRole ¶ added in v0.39.0
func UpdateClusterRole(kubeClient kubernetes.Interface, clusterRole *rbacv1.ClusterRole) error
func UpdateDeployment ¶ added in v0.31.0
func UpdateDeployment(kubeCilent kubernetes.Interface, deployment *appsv1.Deployment) (*appsv1.Deployment, error)
func WaitForCRDReady ¶ added in v0.39.0
WaitForCRDReady waits for a Custom Resource Definition to be available for use.
func WaitForPodsReady ¶
func WaitForPodsReady(kubeClient kubernetes.Interface, namespace string, timeout time.Duration, expectedReplicas int, opts metav1.ListOptions) error
WaitForPodsReady waits for a selection of Pods to be running and each container to pass its readiness check.
func WaitForPodsRunImage ¶
func WaitForPodsRunImage(kubeClient kubernetes.Interface, namespace string, expectedReplicas int, image string, opts metav1.ListOptions) error
func WaitForServiceReady ¶
func WaitForServiceReady(kubeClient kubernetes.Interface, namespace string, serviceName string) error
func WaitUntilDeploymentGone ¶
Types ¶
type Framework ¶
type Framework struct { KubeClient kubernetes.Interface MonClientV1 monitoringclient.MonitoringV1Interface APIServerClient apiclient.Interface HTTPClient *http.Client MasterHost string DefaultTimeout time.Duration }
func (*Framework) AddAlertingToPrometheus ¶
func (f *Framework) AddAlertingToPrometheus(p *monitoringv1.Prometheus, ns, name string)
func (*Framework) AddRemoteWriteWithTLSToPrometheus ¶ added in v0.41.0
func (f *Framework) AddRemoteWriteWithTLSToPrometheus(p *monitoringv1.Prometheus, url string, prwtc PromRemoteWriteTestConfig)
func (*Framework) AlertmanagerConfigSecret ¶
func (*Framework) CheckPrometheusFiringAlert ¶ added in v0.24.0
func (*Framework) CreateAlertmanagerAndWaitUntilReady ¶
func (f *Framework) CreateAlertmanagerAndWaitUntilReady(ns string, a *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
func (*Framework) CreateBlackBoxExporterAndWaitUntilReady ¶ added in v0.41.0
func (*Framework) CreateCRD ¶ added in v0.39.0
func (f *Framework) CreateCRD(crd *v1.CustomResourceDefinition) error
CreateCRD creates a custom resource definition on the apiserver.
func (*Framework) CreateCRDAndWaitUntilReady ¶ added in v0.39.0
func (f *Framework) CreateCRDAndWaitUntilReady(crdName string, listFunc func(opts metav1.ListOptions) (runtime.Object, error)) error
CreateCRDAndWaitUntilReady creates a Custom Resource Definition from yaml manifest on the apiserver and wait until it is available for use.
func (*Framework) CreatePrometheusAndWaitUntilReady ¶
func (f *Framework) CreatePrometheusAndWaitUntilReady(ns string, p *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
func (*Framework) CreatePrometheusOperator ¶ added in v0.24.0
func (f *Framework) CreatePrometheusOperator(ns, opImage string, namespaceAllowlist, namespaceDenylist, prometheusInstanceNamespaces, alertmanagerInstanceNamespaces []string, createRuleAdmissionHooks bool) ([]finalizerFn, error)
CreatePrometheusOperator creates a Prometheus Operator Kubernetes Deployment inside the specified namespace using the specified operator image. In addition one can specify the namespaces to watch, which defaults to all namespaces. Returns the CA, which can bs used to access the operator over TLS
func (*Framework) CreateRule ¶ added in v0.20.0
func (f *Framework) CreateRule(ns string, ar *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
func (*Framework) CreateSilence ¶ added in v0.18.1
func (*Framework) CreateThanosRulerAndWaitUntilReady ¶ added in v0.36.0
func (f *Framework) CreateThanosRulerAndWaitUntilReady(ns string, tr *monitoringv1.ThanosRuler) (*monitoringv1.ThanosRuler, error)
func (*Framework) DeleteAlertmanagerAndWaitUntilGone ¶
func (*Framework) DeletePrometheusAndWaitUntilGone ¶
func (*Framework) DeleteRule ¶ added in v0.22.0
func (*Framework) DeleteThanosRulerAndWaitUntilGone ¶ added in v0.36.0
func (*Framework) GetActiveTargets ¶
func (*Framework) GetAlertmanagerMetrics ¶ added in v0.41.0
func (*Framework) GetAlertmanagerStatus ¶ added in v0.29.0
func (*Framework) GetCRD ¶ added in v0.35.0
func (f *Framework) GetCRD(name string) (*v1.CustomResourceDefinition, error)
GetCRD gets a custom resource definition from the apiserver.
func (*Framework) GetHealthyTargets ¶ added in v0.41.0
func (*Framework) GetPodRestartCount ¶ added in v0.24.0
GetPodRestartCount returns a map of container names and their restart counts for a given pod.
func (*Framework) GetRule ¶ added in v0.31.0
func (f *Framework) GetRule(ns, name string) (*monitoringv1.PrometheusRule, error)
func (*Framework) GetSilences ¶ added in v0.18.1
func (*Framework) ListCRDs ¶ added in v0.35.0
func (f *Framework) ListCRDs() (*v1.CustomResourceDefinitionList, error)
ListCRDs gets a list of custom resource definitions from the apiserver.
func (*Framework) MakeAlertmanagerService ¶
func (*Framework) MakeAndCreateFiringRule ¶ added in v0.20.0
func (f *Framework) MakeAndCreateFiringRule(ns, name, alertName string) (*monitoringv1.PrometheusRule, error)
func (*Framework) MakeAndCreateInvalidRule ¶ added in v0.31.0
func (f *Framework) MakeAndCreateInvalidRule(ns, name, alertName string) (*monitoringv1.PrometheusRule, error)
func (*Framework) MakeBasicAlertmanager ¶
func (f *Framework) MakeBasicAlertmanager(name string, replicas int32) *monitoringv1.Alertmanager
func (*Framework) MakeBasicPrometheus ¶
func (f *Framework) MakeBasicPrometheus(ns, name, group string, replicas int32) *monitoringv1.Prometheus
func (*Framework) MakeBasicRule ¶ added in v0.20.0
func (f *Framework) MakeBasicRule(ns, name string, groups []monitoringv1.RuleGroup) *monitoringv1.PrometheusRule
func (*Framework) MakeBasicServiceMonitor ¶
func (f *Framework) MakeBasicServiceMonitor(name string) *monitoringv1.ServiceMonitor
func (*Framework) MakeBasicStaticProbe ¶ added in v0.41.0
func (f *Framework) MakeBasicStaticProbe(name, url string, targets []string) *monitoringv1.Probe
func (*Framework) MakeBasicThanosRuler ¶ added in v0.36.0
func (f *Framework) MakeBasicThanosRuler(name string, replicas int32) *monitoringv1.ThanosRuler
func (*Framework) MakeBlackBoxExporterService ¶ added in v0.41.0
func (*Framework) MakeCRD ¶ added in v0.39.0
func (f *Framework) MakeCRD(pathToYaml string) (*v1.CustomResourceDefinition, error)
MakeCRD creates a CustomResourceDefinition object from yaml manifest.
func (*Framework) MakeEchoDeployment ¶ added in v0.34.0
func (f *Framework) MakeEchoDeployment(group string) *appsv1.Deployment
func (*Framework) MakeEchoService ¶ added in v0.34.0
func (*Framework) MakePrometheusService ¶
func (*Framework) MakeThanosQuerierService ¶ added in v0.21.0
func (*Framework) PrintEvents ¶ added in v0.22.0
PrintEvents prints the Kubernetes events to standard out.
func (*Framework) PrintPodLogs ¶ added in v0.22.0
PrintPodLogs prints the logs of a specified Pod
func (*Framework) PrometheusSVCGetRequest ¶ added in v0.34.0
func (*Framework) SecretFromYaml ¶
func (*Framework) SendAlertToAlertmanager ¶ added in v0.24.0
SendAlertToAlertmanager sends an alert to the alertmanager in the given namespace (ns) with the given name (n).
func (*Framework) UpdateAlertmanagerAndWaitUntilReady ¶
func (f *Framework) UpdateAlertmanagerAndWaitUntilReady(ns string, a *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
func (*Framework) UpdatePrometheusAndWaitUntilReady ¶
func (f *Framework) UpdatePrometheusAndWaitUntilReady(ns string, p *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
func (*Framework) UpdateRule ¶ added in v0.20.0
func (f *Framework) UpdateRule(ns string, ar *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
func (*Framework) UpdateThanosRulerAndWaitUntilReady ¶ added in v0.36.0
func (f *Framework) UpdateThanosRulerAndWaitUntilReady(ns string, tr *monitoringv1.ThanosRuler) (*monitoringv1.ThanosRuler, error)
func (*Framework) WaitForActiveTargets ¶ added in v0.41.0
WaitForActiveTargets waits for a number of targets to be configured.
func (*Framework) WaitForAlertmanagerConfigToBeReloaded ¶ added in v0.41.0
func (*Framework) WaitForAlertmanagerConfigToContainString ¶ added in v0.20.0
func (f *Framework) WaitForAlertmanagerConfigToContainString(ns, amName, expectedString string) error
WaitForAlertmanagerConfigToContainString retrieves the Alertmanager configuration via the Alertmanager's API and checks if it contains the given string.
func (*Framework) WaitForAlertmanagerInitialized ¶ added in v0.38.2
func (*Framework) WaitForAlertmanagerReady ¶
WaitForAlertmanagerReady waits for each individual pod as well as the cluster as a whole to be ready.
func (*Framework) WaitForConfigMapExist ¶ added in v0.20.0
func (*Framework) WaitForConfigMapNotExist ¶ added in v0.20.0
func (*Framework) WaitForDiscoveryWorking ¶ added in v0.34.0
func (*Framework) WaitForHealthyTargets ¶ added in v0.41.0
WaitForHealthyTargets waits for a number of targets to be configured and healthy.
func (*Framework) WaitForPrometheusFiringAlert ¶ added in v0.19.0
func (*Framework) WaitForPrometheusReady ¶
func (f *Framework) WaitForPrometheusReady(p *monitoringv1.Prometheus, timeout time.Duration) error
func (*Framework) WaitForPrometheusRunImageAndReady ¶
func (f *Framework) WaitForPrometheusRunImageAndReady(ns string, p *monitoringv1.Prometheus) error
func (*Framework) WaitForRule ¶ added in v0.20.0
WaitForRule waits for a rule file with a given name to exist in a given namespace.
func (*Framework) WaitForThanosRulerReady ¶ added in v0.36.0
func (f *Framework) WaitForThanosRulerReady(tr *monitoringv1.ThanosRuler, timeout time.Duration) error
type PromRemoteWriteTestConfig ¶ added in v0.41.0
type PrometheusQueryAPIResponse ¶ added in v0.34.0
type PrometheusQueryAPIResponse struct { Status string `json:"status"` Data *PrometheusQueryData `json:"data"` }
type PrometheusQueryData ¶ added in v0.34.0
type PrometheusQueryData struct { ResultType string `json:"resultType"` Result []PrometheusQueryResult `json:"result"` }
type PrometheusQueryResult ¶ added in v0.34.0
type TestCtx ¶
type TestCtx struct { ID string // contains filtered or unexported fields }
func (*TestCtx) AddFinalizerFn ¶
func (ctx *TestCtx) AddFinalizerFn(fn finalizerFn)
func (*TestCtx) CreateNamespace ¶
func (*TestCtx) GetObjID ¶
GetObjID returns an ascending ID based on the length of cleanUpFns. It is based on the premise that every new object also appends a new finalizerFn on cleanUpFns. This can e.g. be used to create multiple namespaces in the same test context.
func (*TestCtx) SetupPrometheusRBAC ¶
func (*TestCtx) SetupPrometheusRBACGlobal ¶ added in v0.23.0
Source Files ¶
- admission-webhooks.go
- alertmanager.go
- cluster_role.go
- cluster_role_binding.go
- config_map.go
- context.go
- crd.go
- deployment.go
- event.go
- framework.go
- helpers.go
- ingress.go
- namespace.go
- pod.go
- probe.go
- prometheus.go
- prometheus_rule.go
- replication-controller.go
- role-binding.go
- secret.go
- service.go
- service_account.go
- thanosruler.go