Documentation ¶
Index ¶
- Constants
- func Certificate() string
- func DeferredGoroutineLeakDetector(t *testing.T) func()
- func Endpoint(i int) *v1.Endpoint
- func EnvoyDumpOnFail(_ io.Writer, namespaces ...string) func()
- func EventuallyObjectDeleted(getter ObjectGetter, intervals ...interface{})
- func EventuallyObjectDeletedWithOffset(offset int, getter ObjectGetter, intervals ...interface{})
- func EventuallyResourceAccepted(getter InputResourceGetter, intervals ...interface{})
- func EventuallyResourceAcceptedWithOffset(offset int, getter InputResourceGetter, intervals ...interface{})
- func EventuallyResourceDeleted(getter InputResourceGetter, intervals ...interface{})
- func EventuallyResourceDeletedWithOffset(offset int, getter InputResourceGetter, intervals ...interface{})
- func EventuallyResourceRejected(getter InputResourceGetter, intervals ...interface{})
- func EventuallyResourceStatusMatchesState(offset int, getter InputResourceGetter, desiredStatusState core.Status_State, ...)
- func EventuallyResourceWarning(getter InputResourceGetter, intervals ...interface{})
- func GenerateBenchmarkDesc(b *ScaledSnapshotBuilder, _ *BenchmarkConfig, labels ...string) string
- func GetCallerDirectory(skip ...int) (string, error)
- func GetCertificateFromString(certificate string) *x509.Certificate
- func GetCerts(params Params) (string, string)
- func GetKubeSecret(name, namespace string) *kubev1.Secret
- func GetPrivateKeyRSAFromString(privateKey string) *rsa.PrivateKey
- func GetTlsSecret(name, namespace string) *v1.Secret
- func GlooDir() string
- func GlooHelmChartDir() string
- func GlooInstallDir() string
- func GlooTestContainersDir() string
- func HttpListener(numRoutes int) *v1.Listener
- func KubeDumpOnFail(out io.Writer, namespaces ...string) func()
- func MakeGatewayRoute(pathType, length int) *gatewayv1.Route
- func MakeMatcher(pathType, length int) *matchers.Matcher
- func MakeMultiMatcherRoute(pathType1, length1, pathType2, length2 int) *gloov1.Route
- func MakeRoute(pathType, length int) *gloov1.Route
- func Measure(f func()) (benchmarking.Result, error)
- func MeasureIgnore0ns(f func()) (benchmarking.Result, bool, error)
- func MtlsCertificate() string
- func MtlsPrivateKey() string
- func Must(err error)
- func MustReadFile(name string) []byte
- func PatchResource(ctx context.Context, resourceRef *core.ResourceRef, ...) error
- func PatchResourceWithOffset(offset int, ctx context.Context, resourceRef *core.ResourceRef, ...) error
- func PercentileIndex(len, pct int) int
- func PrintGlooDebugLogs()
- func PrivateKey() string
- func Proxy(numRoutes int) *v1.Proxy
- func ReadMetricByLabel(metricName string, labelKey string, labelValue string) (int, error)
- func RegisterGlooDebugLogPrintHandler()
- func RegisterGlooDebugLogPrintHandlerAndClearLogs()
- func Secret(i int) *v1.Secret
- func StandardGlooDumpOnFail(out io.Writer, namespaces ...string) func()
- func Upstream(i int) *v1.Upstream
- func WriteDefaultGateways(writeNamespace string, gatewayClient v1.GatewayClient) error
- type BenchmarkConfig
- type EndpointBuilder
- type FakeOcspResponder
- type InputResourceGetter
- type InputResourceListGetter
- type ObjectGetter
- type Params
- type ResourceClientSet
- type Result
- type RouteBuilder
- func (b *RouteBuilder) Build() *gatewayv1.Route
- func (b *RouteBuilder) Clone() *RouteBuilder
- func (b *RouteBuilder) WithMatcher(matcher *matchers.Matcher) *RouteBuilder
- func (b *RouteBuilder) WithName(name string) *RouteBuilder
- func (b *RouteBuilder) WithPrefixMatcher(prefix string) *RouteBuilder
- func (b *RouteBuilder) WithRouteAction(routeAction *gloov1.RouteAction) *RouteBuilder
- func (b *RouteBuilder) WithRouteActionToUpstreamRef(ref *core.ResourceRef) *RouteBuilder
- func (b *RouteBuilder) WithRouteOptions(opts *gloov1.RouteOptions) *RouteBuilder
- type RouteTableBuilder
- func (b *RouteTableBuilder) Build() *v1.RouteTable
- func (b *RouteTableBuilder) Clone() *RouteTableBuilder
- func (b *RouteTableBuilder) WithName(name string) *RouteTableBuilder
- func (b *RouteTableBuilder) WithNamespace(namespace string) *RouteTableBuilder
- func (b *RouteTableBuilder) WithRoute(name string, route *v1.Route) *RouteTableBuilder
- type ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) Build() *gloosnapshot.ApiSnapshot
- func (b *ScaledSnapshotBuilder) EndpointCount() int
- func (b *ScaledSnapshotBuilder) HasInjectedSnapshot() bool
- func (b *ScaledSnapshotBuilder) SecretCount() int
- func (b *ScaledSnapshotBuilder) UpstreamCount() int
- func (b *ScaledSnapshotBuilder) WithEndpointBuilder(eb *EndpointBuilder) *ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) WithEndpointCount(n int) *ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) WithSecretBuilder(eb *SecretBuilder) *ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) WithSecretCount(n int) *ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) WithUpstreamBuilder(ub *UpstreamBuilder) *ScaledSnapshotBuilder
- func (b *ScaledSnapshotBuilder) WithUpstreamCount(n int) *ScaledSnapshotBuilder
- type SecretBuilder
- type SnapshotWriter
- type SnapshotWriterImpl
- func (s *SnapshotWriterImpl) DeleteSnapshot(snapshot *gloosnapshot.ApiSnapshot, deleteOptions clients.DeleteOpts) error
- func (s *SnapshotWriterImpl) WithRetryOptions(retryOptions []retry.Option) *SnapshotWriterImpl
- func (s *SnapshotWriterImpl) WithWriteNamespace(writeNamespace string) *SnapshotWriterImpl
- func (s *SnapshotWriterImpl) WriteSnapshot(snapshot *gloosnapshot.ApiSnapshot, writeOptions clients.WriteOpts) error
- type UpstreamBuilder
- type VirtualServiceBuilder
- func (b *VirtualServiceBuilder) Build() *v1.VirtualService
- func (b *VirtualServiceBuilder) Clone() *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithDomain(domain string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithDomains(domains []string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithLabel(key, value string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithName(name string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithNamespace(namespace string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRoute(routeName string, route *v1.Route) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteAction(routeName string, routeAction *gloov1.RouteAction) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteActionToMultiDestination(routeName string, destination *gloov1.MultiDestination) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteActionToSingleDestination(routeName string, destination *gloov1.Destination) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteActionToUpstream(routeName string, upstream *gloov1.Upstream) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteActionToUpstreamRef(routeName string, upstreamRef *core.ResourceRef) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteDelegateAction(routeName string, delegateAction *v1.DelegateAction) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteDelegateActionRef(routeName string, delegateRef *core.ResourceRef) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteDelegateActionSelector(routeName string, delegateSelector *v1.RouteTableSelector) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteDirectResponseAction(routeName string, action *gloov1.DirectResponseAction) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteMatcher(routeName string, matcher *matchers.Matcher) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteMutation(routeName string, mutation func(route *v1.Route)) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRouteOptions(routeName string, routeOptions *gloov1.RouteOptions) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithRoutePrefixMatcher(routeName string, prefixMatch string) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithSslConfig(sslConfig *ssl.SslConfig) *VirtualServiceBuilder
- func (b *VirtualServiceBuilder) WithVirtualHostOptions(virtualHostOptions *gloov1.VirtualHostOptions) *VirtualServiceBuilder
Constants ¶
const ( ExactPath = iota PrefixPath RegexPath )
Variables ¶
This section is empty.
Functions ¶
func Certificate ¶ added in v0.10.1
func Certificate() string
Certificate returns the CA certificate for the proxy.
func DeferredGoroutineLeakDetector ¶ added in v1.13.0
DeferredGoroutineLeakDetector returns a function that can be used in tests to identify goroutine leaks Example usage:
leakDetector := DeferredGoroutineLeakDetector(t) defer leakDetector() ...
NOTE TO DEVS: We would like to extend the usage of this across more test suites: https://github.com/solo-io/gloo/issues/7147
func Endpoint ¶ added in v1.15.0
Endpoint returns a generic endpoint included in snapshots generated from ScaledSnapshot The integer argument is used to create a uniquely-named resource which references a corresponding Upstream
func EnvoyDumpOnFail ¶ added in v1.16.0
EnvoyDumpOnFail creates a small dump of the envoy admin interface when a test fails. This is useful for debugging test failures. The dump is written to _output/envoy-dump. The dump includes: - config dump - stats - clusters - listeners
func EventuallyObjectDeleted ¶ added in v1.8.3
func EventuallyObjectDeleted(getter ObjectGetter, intervals ...interface{})
func EventuallyObjectDeletedWithOffset ¶ added in v1.8.3
func EventuallyObjectDeletedWithOffset(offset int, getter ObjectGetter, intervals ...interface{})
func EventuallyResourceAccepted ¶ added in v1.8.3
func EventuallyResourceAccepted(getter InputResourceGetter, intervals ...interface{})
func EventuallyResourceAcceptedWithOffset ¶ added in v1.14.0
func EventuallyResourceAcceptedWithOffset(offset int, getter InputResourceGetter, intervals ...interface{})
func EventuallyResourceDeleted ¶ added in v1.8.3
func EventuallyResourceDeleted(getter InputResourceGetter, intervals ...interface{})
func EventuallyResourceDeletedWithOffset ¶ added in v1.8.3
func EventuallyResourceDeletedWithOffset(offset int, getter InputResourceGetter, intervals ...interface{})
func EventuallyResourceRejected ¶ added in v1.9.0
func EventuallyResourceRejected(getter InputResourceGetter, intervals ...interface{})
func EventuallyResourceStatusMatchesState ¶ added in v1.8.3
func EventuallyResourceStatusMatchesState(offset int, getter InputResourceGetter, desiredStatusState core.Status_State, intervals ...interface{})
func EventuallyResourceWarning ¶ added in v1.8.3
func EventuallyResourceWarning(getter InputResourceGetter, intervals ...interface{})
func GenerateBenchmarkDesc ¶ added in v1.15.0
func GenerateBenchmarkDesc(b *ScaledSnapshotBuilder, _ *BenchmarkConfig, labels ...string) string
func GetCallerDirectory ¶ added in v0.18.17
returns absolute path to the currently executing directory
func GetCertificateFromString ¶ added in v1.14.2
func GetCertificateFromString(certificate string) *x509.Certificate
GetCertificateFromString returns an x509 certificate from the certificate's string representation.
func GetCerts ¶ added in v0.10.1
GetCerts generates a signed key and certificate for the given parameters. If an IssuerKey is provided, the certificate will be signed by that key. Otherwise, a self-signed certificate will be generated.
func GetKubeSecret ¶ added in v0.10.1
func GetPrivateKeyRSAFromString ¶ added in v1.14.2
func GetPrivateKeyRSAFromString(privateKey string) *rsa.PrivateKey
GetPrivateKeyRSAFromString returns an RSA private key from the key's string representation.
func GetTlsSecret ¶ added in v1.15.13
func GlooHelmChartDir ¶ added in v0.10.1
func GlooHelmChartDir() string
func GlooInstallDir ¶ added in v0.10.1
func GlooInstallDir() string
func GlooTestContainersDir ¶ added in v0.10.1
func GlooTestContainersDir() string
func HttpListener ¶ added in v1.15.0
HttpListener returns a generic Listener with HttpListener ListenerType and the specified number of routes
func KubeDumpOnFail ¶ added in v0.18.9
KubeDumpOnFail creates a small dump of the kubernetes state when a test fails. This is useful for debugging test failures. The dump is written to _output/kube2e-artifacts. The dump includes: - docker state - process state - kubernetes state - logs from all pods in the given namespaces - yaml representations of all solo.io CRs in the given namespaces
func MakeGatewayRoute ¶ added in v0.18.32
func MakeMatcher ¶ added in v1.0.0
func MakeMultiMatcherRoute ¶ added in v1.0.0
func Measure ¶ added in v1.15.0
func Measure(f func()) (benchmarking.Result, error)
Measure wraps benchmarking.Measure 1:1 It is redefined here so that we can build with a darwin-compatible version depending on the machine being used
func MeasureIgnore0ns ¶ added in v1.15.0
func MeasureIgnore0ns(f func()) (benchmarking.Result, bool, error)
MeasureIgnore0ns wraps benchmarking.Measure, checking error values for the 0ns error and returning true as the middle argument if that is the error The 0ns error occurs when measuring very short durations (~100µs) when measurements may round down to 0ns This function should be used in circumstances where we want to ignore that particular error but not others
func MtlsCertificate ¶ added in v1.14.0
func MtlsCertificate() string
MtlsCertificate returns an mTLS CA certificate for the proxy.
func MtlsPrivateKey ¶ added in v1.14.0
func MtlsPrivateKey() string
MtlsPrivateKey returns an mTLS CA private key for the proxy.
func MustReadFile ¶ added in v0.18.17
returns absolute path to the currently executing directory
func PatchResource ¶ added in v1.12.32
func PatchResource(ctx context.Context, resourceRef *core.ResourceRef, mutator func(resource resources.Resource) resources.Resource, client clients.ResourceClient) error
PatchResource mutates an existing persisted resource, retrying if a resourceVersionError is encountered The mutator method must return the full object that will be persisted, any side effects from the mutator will be ignored
func PatchResourceWithOffset ¶ added in v1.12.32
func PatchResourceWithOffset(offset int, ctx context.Context, resourceRef *core.ResourceRef, mutator func(resource resources.Resource) resources.Resource, client clients.ResourceClient) error
PatchResourceWithOffset mutates an existing persisted resource, retrying if a resourceVersionError is encountered The mutator method must return the full object that will be persisted, any side effects from the mutator will be ignored
func PercentileIndex ¶ added in v1.15.0
PercentileIndex returns the index of percentile pct for a slice of length len The Nearest Rank Method is used to determine percentiles (https://en.wikipedia.org/wiki/Percentile#The_nearest-rank_method) Valid inputs for pct are 0 < n <= 100, any other input will cause panic
func PrintGlooDebugLogs ¶ added in v1.0.0
func PrintGlooDebugLogs()
func PrivateKey ¶ added in v0.10.1
func PrivateKey() string
PrivateKey returns the CA private key for the proxy.
func Proxy ¶ added in v1.15.0
Proxy returns a generic proxy that can be used for translation benchmarking Proxy invokes functions that contain assertions and therefore can only be invoked from within a test block
func ReadMetricByLabel ¶ added in v1.9.25
ReadMetricByLabel looks up the specified metricName and returns the latest data recorded for the time series with the specified label key/value pair.
If the metric has not yet been registered, this function will fail. If the metric has been registered, but there is not yet any time series data recorded with the label key/value provided, then an error is returned. The error response allows tests to distinguish "the metric was never recorded" from "a value of 0 was recorded"
func RegisterGlooDebugLogPrintHandler ¶ added in v0.18.12
func RegisterGlooDebugLogPrintHandler()
func RegisterGlooDebugLogPrintHandlerAndClearLogs ¶ added in v0.18.12
func RegisterGlooDebugLogPrintHandlerAndClearLogs()
func StandardGlooDumpOnFail ¶ added in v1.16.0
StandardGlooDumpOnFail creates adump of the kubernetes state and certain envoy data from the admin interface when a test fails Look at `KubeDumpOnFail` && `EnvoyDumpOnFail` for more details
func Upstream ¶ added in v1.15.0
Upstream returns a generic upstream included in snapshots generated from ScaledSnapshot The integer argument is used to create a uniquely-named resource
func WriteDefaultGateways ¶ added in v1.2.13
func WriteDefaultGateways(writeNamespace string, gatewayClient v1.GatewayClient) error
Types ¶
type BenchmarkConfig ¶ added in v1.15.0
type BenchmarkConfig struct { Iterations int // the number of iterations to attempt for a particular entry MaxDur time.Duration // the maximum time to spend on a particular entry even if not all iterations are complete LocalMatchers []types.GomegaMatcher // matchers representing the assertions we wish to make for a particular entry when running locally GhaMatchers []types.GomegaMatcher // matchers representing the assertions we wish to make for a particular entry when running in a GHA }
BenchmarkConfig allows configuration for benchmarking tests to be reused for similar cases This struct can be factored out to an accessible location should additional benchmarking suites be added
func (*BenchmarkConfig) GetMatchers ¶ added in v1.15.0
func (bc *BenchmarkConfig) GetMatchers() []types.GomegaMatcher
type EndpointBuilder ¶ added in v1.15.0
type EndpointBuilder struct{}
EndpointBuilder contains options for building Endpoints to be included in scaled Snapshots there are no options currently configurable for the endpointBuilder
func NewEndpointBuilder ¶ added in v1.15.0
func NewEndpointBuilder() *EndpointBuilder
type FakeOcspResponder ¶ added in v1.14.2
type FakeOcspResponder struct {
// contains filtered or unexported fields
}
FakeOcspResponder is a fake OCSP responder that can be used to generate OCSP responses.
func NewFakeOcspResponder ¶ added in v1.14.2
func NewFakeOcspResponder(rootCa *x509.Certificate, rootKey interface{}) *FakeOcspResponder
NewFakeOcspResponder creates a new fake OCSP responder from the given root CA.
func (*FakeOcspResponder) GetOcspResponse ¶ added in v1.14.2
func (f *FakeOcspResponder) GetOcspResponse(certificate *x509.Certificate, expiration time.Duration, isRevoked bool, resp ocsp.Response) []byte
GetOcspResponse returns a DER-encoded OCSP response for the given certificate. You pass it the certificate to get a response for, the expiration time of the response, and whether the certificate should be revoked. You can also pass it an ocsp.Response to use as a template for the response. This allows for customizing the response wanted.
type InputResourceGetter ¶ added in v1.8.3
type InputResourceGetter func() (resources.InputResource, error)
type InputResourceListGetter ¶ added in v1.8.3
type InputResourceListGetter func() (resources.InputResourceList, error)
type ObjectGetter ¶ added in v1.8.3
type Params ¶ added in v0.10.1
type Params struct { Hosts string // Comma-separated hostnames and IPs to generate a certificate for ValidFrom *time.Time // Creation date ValidFor *time.Duration // Duration that certificate is valid for IsCA bool // whether this cert should be its own Certificate Authority RsaBits int // Size of RSA key to generate. Ignored if EcdsaCurve is set EcdsaCurve string // ECDSA curve to use to generate a key. Valid values are P224, P256 (recommended), P384, P521 AdditionalUsages []x509.ExtKeyUsage // Usages to define in addition to default x509.ExtKeyUsageServerAuth IssuerKey interface{} // If provided, the certificate will be signed by this key }
Params includes parameters used to generate an x509 certificate.
type ResourceClientSet ¶ added in v1.12.21
type ResourceClientSet interface { GatewayClient() gatewayv1.GatewayClient HttpGatewayClient() gatewayv1.MatchableHttpGatewayClient TcpGatewayClient() gatewayv1.MatchableTcpGatewayClient VirtualServiceClient() gatewayv1.VirtualServiceClient RouteTableClient() gatewayv1.RouteTableClient VirtualHostOptionClient() gatewayv1.VirtualHostOptionClient RouteOptionClient() gatewayv1.RouteOptionClient SettingsClient() gloov1.SettingsClient UpstreamGroupClient() gloov1.UpstreamGroupClient UpstreamClient() gloov1.UpstreamClient ProxyClient() gloov1.ProxyClient AuthConfigClient() extauthv1.AuthConfigClient RateLimitConfigClient() externalrl.RateLimitConfigClient SecretClient() gloov1.SecretClient ArtifactClient() gloov1.ArtifactClient }
type Result ¶ added in v1.15.0
type Result struct { // Time spent in user mode Utime time.Duration // Time spent in kernel mode Stime time.Duration // Time spent in user mode + kernel mode Total time.Duration }
Result represents the result of measuring a function's execution time.
type RouteBuilder ¶ added in v1.14.20
type RouteBuilder struct {
// contains filtered or unexported fields
}
RouteBuilder simplifies the process of generating Routes in tests
func BuilderFromRoute ¶ added in v1.14.20
func BuilderFromRoute(r *gatewayv1.Route) *RouteBuilder
BuilderFromRoute creates a new RouteBuilder from an existing Route
func NewRouteBuilder ¶ added in v1.14.20
func NewRouteBuilder() *RouteBuilder
NewRouteBuilder creates an empty RouteBuilder
func (*RouteBuilder) Build ¶ added in v1.14.20
func (b *RouteBuilder) Build() *gatewayv1.Route
func (*RouteBuilder) Clone ¶ added in v1.14.20
func (b *RouteBuilder) Clone() *RouteBuilder
func (*RouteBuilder) WithMatcher ¶ added in v1.14.20
func (b *RouteBuilder) WithMatcher(matcher *matchers.Matcher) *RouteBuilder
func (*RouteBuilder) WithName ¶ added in v1.14.20
func (b *RouteBuilder) WithName(name string) *RouteBuilder
func (*RouteBuilder) WithPrefixMatcher ¶ added in v1.14.20
func (b *RouteBuilder) WithPrefixMatcher(prefix string) *RouteBuilder
func (*RouteBuilder) WithRouteAction ¶ added in v1.14.20
func (b *RouteBuilder) WithRouteAction(routeAction *gloov1.RouteAction) *RouteBuilder
func (*RouteBuilder) WithRouteActionToUpstreamRef ¶ added in v1.14.20
func (b *RouteBuilder) WithRouteActionToUpstreamRef(ref *core.ResourceRef) *RouteBuilder
func (*RouteBuilder) WithRouteOptions ¶ added in v1.14.20
func (b *RouteBuilder) WithRouteOptions(opts *gloov1.RouteOptions) *RouteBuilder
type RouteTableBuilder ¶ added in v1.14.20
type RouteTableBuilder struct {
// contains filtered or unexported fields
}
RouteTableBuilder simplifies the process of generating RouteTables in tests
func BuilderFromRouteTable ¶ added in v1.14.20
func BuilderFromRouteTable(rt *v1.RouteTable) *RouteTableBuilder
BuilderFromRouteTable creates a new RouteTableBuilder from an existing RouteTable
func NewRouteTableBuilder ¶ added in v1.14.20
func NewRouteTableBuilder() *RouteTableBuilder
NewRouteTableBuilder creates an empty RouteTableBuilder
func (*RouteTableBuilder) Build ¶ added in v1.14.20
func (b *RouteTableBuilder) Build() *v1.RouteTable
func (*RouteTableBuilder) Clone ¶ added in v1.14.20
func (b *RouteTableBuilder) Clone() *RouteTableBuilder
func (*RouteTableBuilder) WithName ¶ added in v1.14.20
func (b *RouteTableBuilder) WithName(name string) *RouteTableBuilder
func (*RouteTableBuilder) WithNamespace ¶ added in v1.14.20
func (b *RouteTableBuilder) WithNamespace(namespace string) *RouteTableBuilder
func (*RouteTableBuilder) WithRoute ¶ added in v1.14.20
func (b *RouteTableBuilder) WithRoute(name string, route *v1.Route) *RouteTableBuilder
type ScaledSnapshotBuilder ¶ added in v1.15.0
type ScaledSnapshotBuilder struct {
// contains filtered or unexported fields
}
ScaledSnapshotBuilder enumerates the number of each type of resource that should be included in a snapshot and contains a builder for each sub-resource type which is responsible for building instances of that resource Additional fields should be added as needed
func NewInjectedSnapshotBuilder ¶ added in v1.15.0
func NewInjectedSnapshotBuilder(snap *gloosnapshot.ApiSnapshot) *ScaledSnapshotBuilder
NewInjectedSnapshotBuilder takes a snapshot object to be returned directly by Build() All other settings on a builder with an InjectedSnapshot will be ignored
func NewScaledSnapshotBuilder ¶ added in v1.15.0
func NewScaledSnapshotBuilder() *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) Build ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) Build() *gloosnapshot.ApiSnapshot
Build generates a snapshot populated with the specified number of each resource for the builder, using the sub-resource builders to build each sub-resource
func (*ScaledSnapshotBuilder) EndpointCount ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) EndpointCount() int
func (*ScaledSnapshotBuilder) HasInjectedSnapshot ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) HasInjectedSnapshot() bool
func (*ScaledSnapshotBuilder) SecretCount ¶ added in v1.15.11
func (b *ScaledSnapshotBuilder) SecretCount() int
func (*ScaledSnapshotBuilder) UpstreamCount ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) UpstreamCount() int
func (*ScaledSnapshotBuilder) WithEndpointBuilder ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) WithEndpointBuilder(eb *EndpointBuilder) *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) WithEndpointCount ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) WithEndpointCount(n int) *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) WithSecretBuilder ¶ added in v1.15.11
func (b *ScaledSnapshotBuilder) WithSecretBuilder(eb *SecretBuilder) *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) WithSecretCount ¶ added in v1.15.11
func (b *ScaledSnapshotBuilder) WithSecretCount(n int) *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) WithUpstreamBuilder ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) WithUpstreamBuilder(ub *UpstreamBuilder) *ScaledSnapshotBuilder
func (*ScaledSnapshotBuilder) WithUpstreamCount ¶ added in v1.15.0
func (b *ScaledSnapshotBuilder) WithUpstreamCount(n int) *ScaledSnapshotBuilder
type SecretBuilder ¶ added in v1.15.11
type SecretBuilder struct{}
SecretBuilder contains options for building Secrets to be included in scaled Snapshots there are no options currently configurable for the SecretBuilder
func NewSecretBuilder ¶ added in v1.15.11
func NewSecretBuilder() *SecretBuilder
type SnapshotWriter ¶ added in v1.12.21
type SnapshotWriter interface { WriteSnapshot(snapshot *gloosnapshot.ApiSnapshot, writeOptions clients.WriteOpts) error DeleteSnapshot(snapshot *gloosnapshot.ApiSnapshot, deleteOptions clients.DeleteOpts) error }
type SnapshotWriterImpl ¶ added in v1.14.11
type SnapshotWriterImpl struct { ResourceClientSet // contains filtered or unexported fields }
func NewSnapshotWriter ¶ added in v1.12.21
func NewSnapshotWriter(clientSet ResourceClientSet) *SnapshotWriterImpl
func (*SnapshotWriterImpl) DeleteSnapshot ¶ added in v1.14.11
func (s *SnapshotWriterImpl) DeleteSnapshot(snapshot *gloosnapshot.ApiSnapshot, deleteOptions clients.DeleteOpts) error
DeleteSnapshot deletes all resources in the ApiSnapshot from the cache, retrying the operation based on the retryOptions
func (*SnapshotWriterImpl) WithRetryOptions ¶ added in v1.14.11
func (s *SnapshotWriterImpl) WithRetryOptions(retryOptions []retry.Option) *SnapshotWriterImpl
WithRetryOptions appends the retryOptions that the SnapshotWriter relies on to the default retry options
func (*SnapshotWriterImpl) WithWriteNamespace ¶ added in v1.14.11
func (s *SnapshotWriterImpl) WithWriteNamespace(writeNamespace string) *SnapshotWriterImpl
WithWriteNamespace sets the namespace that the SnapshotWriter expects resources to be written to This is used when Proxies are deleted, by listing all Proxies in this namespace and removing them
func (*SnapshotWriterImpl) WriteSnapshot ¶ added in v1.14.11
func (s *SnapshotWriterImpl) WriteSnapshot(snapshot *gloosnapshot.ApiSnapshot, writeOptions clients.WriteOpts) error
WriteSnapshot writes all resources in the ApiSnapshot to the cache, retrying the operation based on the retryOptions
type UpstreamBuilder ¶ added in v1.15.0
type UpstreamBuilder struct {
// contains filtered or unexported fields
}
UpstreamBuilder contains options for building Upstreams to be included in scaled Snapshots
func NewUpstreamBuilder ¶ added in v1.15.0
func NewUpstreamBuilder() *UpstreamBuilder
func (*UpstreamBuilder) Build ¶ added in v1.15.0
func (b *UpstreamBuilder) Build(i int) *v1.Upstream
func (*UpstreamBuilder) WithConsistentSni ¶ added in v1.15.0
func (b *UpstreamBuilder) WithConsistentSni() *UpstreamBuilder
func (*UpstreamBuilder) WithHealthChecks ¶ added in v1.15.0
func (b *UpstreamBuilder) WithHealthChecks(healthChecks []*core.HealthCheck) *UpstreamBuilder
func (*UpstreamBuilder) WithUniqueSni ¶ added in v1.15.0
func (b *UpstreamBuilder) WithUniqueSni() *UpstreamBuilder
type VirtualServiceBuilder ¶ added in v1.14.0
type VirtualServiceBuilder struct {
// contains filtered or unexported fields
}
VirtualServiceBuilder simplifies the process of generating VirtualServices in tests
func BuilderFromVirtualService ¶ added in v1.12.21
func BuilderFromVirtualService(vs *v1.VirtualService) *VirtualServiceBuilder
BuilderFromVirtualService creates a new VirtualServiceBuilder from an existing VirtualService
func NewVirtualServiceBuilder ¶ added in v1.9.25
func NewVirtualServiceBuilder() *VirtualServiceBuilder
NewVirtualServiceBuilder creates an empty VirtualServiceBuilder
func (*VirtualServiceBuilder) Build ¶ added in v1.14.0
func (b *VirtualServiceBuilder) Build() *v1.VirtualService
func (*VirtualServiceBuilder) Clone ¶ added in v1.14.0
func (b *VirtualServiceBuilder) Clone() *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithDomain ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithDomain(domain string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithDomains ¶ added in v1.15.0
func (b *VirtualServiceBuilder) WithDomains(domains []string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithLabel ¶ added in v1.15.0
func (b *VirtualServiceBuilder) WithLabel(key, value string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithName ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithName(name string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithNamespace ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithNamespace(namespace string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRoute ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRoute(routeName string, route *v1.Route) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteAction ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteAction(routeName string, routeAction *gloov1.RouteAction) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteActionToMultiDestination ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteActionToMultiDestination(routeName string, destination *gloov1.MultiDestination) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteActionToSingleDestination ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteActionToSingleDestination(routeName string, destination *gloov1.Destination) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteActionToUpstream ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteActionToUpstream(routeName string, upstream *gloov1.Upstream) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteActionToUpstreamRef ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteActionToUpstreamRef(routeName string, upstreamRef *core.ResourceRef) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteDelegateAction ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteDelegateAction(routeName string, delegateAction *v1.DelegateAction) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteDelegateActionRef ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteDelegateActionRef(routeName string, delegateRef *core.ResourceRef) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteDelegateActionSelector ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteDelegateActionSelector(routeName string, delegateSelector *v1.RouteTableSelector) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteDirectResponseAction ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteDirectResponseAction(routeName string, action *gloov1.DirectResponseAction) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteMatcher ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteMatcher(routeName string, matcher *matchers.Matcher) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteMutation ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteMutation(routeName string, mutation func(route *v1.Route)) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRouteOptions ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRouteOptions(routeName string, routeOptions *gloov1.RouteOptions) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithRoutePrefixMatcher ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithRoutePrefixMatcher(routeName string, prefixMatch string) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithSslConfig ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithSslConfig(sslConfig *ssl.SslConfig) *VirtualServiceBuilder
func (*VirtualServiceBuilder) WithVirtualHostOptions ¶ added in v1.14.0
func (b *VirtualServiceBuilder) WithVirtualHostOptions(virtualHostOptions *gloov1.VirtualHostOptions) *VirtualServiceBuilder
Source Files ¶
- benchmark.go
- benchmark_linux.go
- certs.go
- debug.go
- default_gateways.go
- directories.go
- endpoints.go
- glooctl_debug_dump.go
- input_resources.go
- kube_dump.go
- kube_objects.go
- metrics.go
- resource_clientset.go
- route_tables.go
- routes.go
- scaled_snapshots.go
- secrets.go
- snapshot_writer.go
- upstreams.go
- util.go
- virtual_services.go