helpers

package
v0.0.0-...-29f3d6c Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate(namespace, host string, options *k8s.KubectlOptions) error

CreateCertificate creates a certificate resource in the specified namespace.

func CreateHelloWorldApp

func CreateHelloWorldApp(app *HelloworldOpt, opt *k8s.KubectlOptions) error

CreateHelloWorldApp takes a HelloworldOpt type and KubectlOptions arguments to create a HelloWorld app in the environment of your choice.

func DNSLookUp

func DNSLookUp(h string) (string, error)

DNSLookUp returns error if there is not DNS entry for an endpoint, used with retry library from terratest

func GetClientConfigE

func GetClientConfigE(t testing.TestingT, options *k8s.KubectlOptions) (*rest.Config, error)

GetClientConfig returns a Kubernetes API clientset given a configured KubectlOptions object.

func GetPrometheusClientSetE

func GetPrometheusClientSetE(t testing.TestingT, options *k8s.KubectlOptions) (*prom.MonitoringV1Client, error)

func GetSearchResults

func GetSearchResults(values SearchData, search string, awsSigner *signer.Signer, client *http.Client)

func GetServiceMonitorSet

func GetServiceMonitorSet(t testing.TestingT, options *k8s.KubectlOptions, serviceMonitorName string) *v1.ServiceMonitor

GetServiceMonitorSet returns a serviceMonitor resource in the provided namespace with the given name. This will fail the test if there is an error.

func GetServiceMonitorSetE

func GetServiceMonitorSetE(t testing.TestingT, options *k8s.KubectlOptions, serviceMonitorName string) (*v1.ServiceMonitor, error)

GetServiceMonitorSetE returns a serviceMonitor resource in the provided namespace with the given name.

func HttpStatusCode

func HttpStatusCode(u string) (int, error)

HttpStatusCode return the HTTP code for an endpoint

func RecordSets

func RecordSets(d, hostedZone string) (bool, error)

RecordSets uses the AWS API to return domain entry existence in Route53 using the hostzone ID specified in the configuration

func TemplateFile

func TemplateFile(f string, n string, m interface{}) (string, error)

TemplateFile returns a string with the content of a template rendered

func WaitForCertificateToBeReady

func WaitForCertificateToBeReady(certName string, options *k8s.KubectlOptions, retries, retryInterval int) error

WaitForCertificateToBeReady takes a certificate name and KubectlOptions arguments along with an along with an appropriate number of retries. It will wait until the certificate returns a status of Ready. The time between retries is specified by the retryInterval argument. If the certificate does not return a status of Ready after the specified number of retries, an error is returned.

Types

type BoolData

type BoolData struct {
	Bool MustFilterData `json:"bool"`
}

type FilterData

type FilterData struct {
	Match PhraseData `json:"match_phrase"`
}

type HelloworldOpt

type HelloworldOpt struct {
	Class             string `default:"default"`
	Identifier        string `default:"integration-test-green"`
	Weight            string `default:"\"100\""`
	Hostname          string `example:"hostname.cloud-platform...."`
	Namespace         string `default:"default"`
	IngressRetryCount int    `default:"5"`
}

HellowoldOpt type allows you to specify options for deploying a helloworld app template in a cluster.

type MustFilterData

type MustFilterData struct {
	Must   []interface{} `json:"must"`
	Filter []FilterData  `json:"filter"`
}

type PhraseData

type PhraseData struct {
	Log       string `json:"log,omitempty"`
	Stream    string `json:"stream,omitempty"`
	HttpCode  int    `json:"transaction.response.http_code,omitempty"`
	Namespace string `json:"kubernetes.namespace_name,omitempty"`
}

type SearchData

type SearchData struct {
	Query BoolData `json:"query"`
}

Jump to

Keyboard shortcuts

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