mock

package
v0.0.0-...-3378e2a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExampleVirtualService is an example V2 route rule
	ExampleVirtualService = &networking.VirtualService{
		Hosts: []string{"prod", "test"},
		Http: []*networking.HTTPRoute{
			{
				Route: []*networking.HTTPRouteDestination{
					{
						Destination: &networking.Destination{
							Host: "job",
						},
						Weight: 80,
					},
				},
			},
		},
	}

	ExampleServiceEntry = &networking.ServiceEntry{
		Hosts:      []string{"*.google.com"},
		Resolution: networking.ServiceEntry_NONE,
		Ports: []*networking.ServicePort{
			{Number: 80, Name: "http-name", Protocol: "http"},
			{Number: 8080, Name: "http2-name", Protocol: "http2"},
		},
	}

	ExampleGateway = &networking.Gateway{
		Servers: []*networking.Server{
			{
				Hosts: []string{"google.com"},
				Port:  &networking.Port{Name: "http", Protocol: "http", Number: 10080},
			},
		},
	}

	// ExampleDestinationRule is an example destination rule
	ExampleDestinationRule = &networking.DestinationRule{
		Host: "ratings",
		TrafficPolicy: &networking.TrafficPolicy{
			LoadBalancer: &networking.LoadBalancerSettings{
				LbPolicy: new(networking.LoadBalancerSettings_Simple),
			},
		},
	}

	// ExampleAuthorizationPolicy is an example AuthorizationPolicy
	ExampleAuthorizationPolicy = &authz.AuthorizationPolicy{
		Selector: &api.WorkloadSelector{
			MatchLabels: map[string]string{
				"app":     "httpbin",
				"version": "v1",
			},
		},
	}
)

Functions

func CheckCacheEvents

func CheckCacheEvents(store model.ConfigStore, cache model.ConfigStoreController, namespace string, n int, t *testing.T)

CheckCacheEvents validates operational invariants of a cache

func CheckCacheFreshness

func CheckCacheFreshness(cache model.ConfigStoreController, namespace string, t *testing.T)

CheckCacheFreshness validates operational invariants of a cache

func CheckCacheSync

func CheckCacheSync(store model.ConfigStore, cache model.ConfigStoreController, namespace string, n int, t *testing.T)

CheckCacheSync validates operational invariants of a cache against the non-cached client.

func CheckIstioConfigTypes

func CheckIstioConfigTypes(store model.ConfigStore, namespace string, t *testing.T)

CheckIstioConfigTypes validates that an empty store can ingest Istio config objects

func CheckMapInvariant

func CheckMapInvariant(r model.ConfigStore, t *testing.T, namespace string, n int)

CheckMapInvariant validates operational invariants of an empty config registry

func Compare

func Compare(a, b config2.Config) bool

Compare checks two configs ignoring revisions and creation time

func Make

func Make(namespace string, i int) config2.Config

Make creates a mock config indexed by a number

Types

This section is empty.

Jump to

Keyboard shortcuts

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