Documentation ¶
Index ¶
- Constants
- Variables
- func GetTargets(targetGroup *vpclattice.TargetGroupSummary, deployment *appsv1.Deployment, ...) ([]string, []*vpclattice.TargetSummary)
- func Logger(ctx context.Context) *zap.SugaredLogger
- func MustMerge[T interface{}](dest T, srcs ...T) T
- func New[T client.Object](t T, mergeFrom ...T) T
- func NewContext(t *testing.T) context.Context
- func NewGrpcurlRunnerPod(name, namespace string) *v1.Pod
- func RandomName() string
- type ElasticSearchOptions
- type Framework
- func (env *Framework) AreAllLatticeTargetsHealthy(ctx context.Context, tg *vpclattice.TargetGroupSummary) (bool, error)
- func (env *Framework) CreateServiceExport(service *v1.Service) *anv1alpha1.ServiceExport
- func (env *Framework) CreateServiceExportAndServiceImportByService(service *v1.Service) (*anv1alpha1.ServiceExport, *anv1alpha1.ServiceImport)
- func (env *Framework) CreateServiceImport(service *v1.Service) *anv1alpha1.ServiceImport
- func (env *Framework) EventuallyExpectNoneFound(ctx context.Context, objectList client.ObjectList)
- func (env *Framework) EventuallyExpectNotFound(ctx context.Context, objects ...client.Object)
- func (env *Framework) ExpectCreated(ctx context.Context, objects ...client.Object)
- func (env *Framework) ExpectDeleteAllToSucceed(ctx context.Context, object client.Object, namespace string)
- func (env *Framework) ExpectDeleted(ctx context.Context, objects ...client.Object)
- func (env *Framework) ExpectDeletedThenNotFound(ctx context.Context, objects ...client.Object)
- func (env *Framework) ExpectToBeClean(ctx context.Context)
- func (env *Framework) ExpectUpdated(ctx context.Context, objects ...client.Object)
- func (env *Framework) FindTargetGroupFromSpec(ctx context.Context, tgSpec model.TargetGroupSpec) (*vpclattice.TargetGroupSummary, error)
- func (env *Framework) GetAllTargets(ctx context.Context, targetGroup *vpclattice.TargetGroupSummary, ...) ([]string, []*vpclattice.TargetSummary)
- func (env *Framework) GetFullTargetGroupFromSummary(ctx context.Context, tgSummary *vpclattice.TargetGroupSummary) *vpclattice.GetTargetGroupOutput
- func (env *Framework) GetLatticeServiceHttpsListenerNonDefaultRules(ctx context.Context, vpcLatticeService *vpclattice.ServiceSummary) ([]*vpclattice.GetRuleOutput, error)
- func (env *Framework) GetPodsByDeploymentName(deploymentName string, deploymentNamespce string) []corev1.Pod
- func (env *Framework) GetServiceNetwork(ctx context.Context, gateway *gwv1.Gateway) *vpclattice.ServiceNetworkSummary
- func (env *Framework) GetTargetGroup(ctx context.Context, service *corev1.Service) *vpclattice.TargetGroupSummary
- func (env *Framework) GetTargetGroupWithProtocol(ctx context.Context, service *corev1.Service, protocol, protocolVersion string) *vpclattice.TargetGroupSummary
- func (env *Framework) GetTargets(ctx context.Context, targetGroup *vpclattice.TargetGroupSummary, ...) []*vpclattice.TargetSummary
- func (env *Framework) GetVpcLatticeService(ctx context.Context, route core.Route) *vpclattice.ServiceSummary
- func (env *Framework) GetVpcLatticeServiceDns(httpRouteName string, httpRouteNamespace string) string
- func (env *Framework) IsVpcAssociatedWithServiceNetwork(ctx context.Context, vpcId string, ...) (bool, *vpclattice.ServiceNetworkVpcAssociationSummary, error)
- func (env *Framework) NewGRPCRoute(namespace string, parentRefsGateway *gwv1.Gateway, ...) *v1alpha2.GRPCRoute
- func (env *Framework) NewGateway(name string, namespace string) *gwv1.Gateway
- func (env *Framework) NewGrpcBin(options GrpcAppOptions) (*appsv1.Deployment, *v1.Service)
- func (env *Framework) NewGrpcHelloWorld(options GrpcAppOptions) (*appsv1.Deployment, *v1.Service)
- func (env *Framework) NewHeaderMatchHttpRoute(parentRefsGateway *gwv1.Gateway, services []*v1.Service) *gwv1.HTTPRoute
- func (env *Framework) NewHttpApp(options HTTPAppOptions) (*appsv1.Deployment, *v1.Service)
- func (env *Framework) NewHttpRoute(parentRefsGateway *gwv1.Gateway, service *v1.Service, kind string) *gwv1.HTTPRoute
- func (env *Framework) NewMethodMatchHttpRoute(parentRefsGateway *gwv1.Gateway, getService *v1.Service, ...) *gwv1.HTTPRoute
- func (env *Framework) NewNginxApp(options ElasticSearchOptions) (*appsv1.Deployment, *v1.Service)
- func (env *Framework) NewPathMatchHttpRoute(parentRefsGateway *gwv1.Gateway, backendRefObjects []client.Object, ...) *gwv1.HTTPRoute
- func (env *Framework) NewTestTags(testSuite string) map[string]*string
- func (env *Framework) NewWeightedRoutingHttpRoute(parentRefsGateway *gwv1.Gateway, backendRefObjectAndWeights []*ObjectAndWeight, ...) *gwv1.HTTPRoute
- func (env *Framework) PodExec(pod corev1.Pod, cmd string) (string, string, error)
- func (env *Framework) RunGrpcurlCmd(opts RunGrpcurlCmdOptions) (string, string, error)
- func (env *Framework) SleepForRouteUpdate()
- func (env *Framework) VerifyTargetGroupNotFound(tg *vpclattice.TargetGroupSummary)
- type GrpcAppOptions
- type HTTPAppOptions
- type ObjectAndWeight
- type RunGrpcurlCmdOptions
- type TestObject
Constants ¶
View Source
const (
K8sNamespace = "e2e-test"
)
Variables ¶
View Source
var ( CurrentClusterVpcId = os.Getenv("CLUSTER_VPC_ID") TestObjects = []TestObject{ {&gwv1.HTTPRoute{}, &gwv1.HTTPRouteList{}}, {&anv1alpha1.ServiceExport{}, &anv1alpha1.ServiceExportList{}}, {&anv1alpha1.ServiceImport{}, &anv1alpha1.ServiceImportList{}}, {&gwv1.Gateway{}, &gwv1.GatewayList{}}, {&appsv1.Deployment{}, &appsv1.DeploymentList{}}, {&corev1.Service{}, &corev1.ServiceList{}}, } )
View Source
var (
DiscoveryLabel = "testing.kubernetes.io"
)
Functions ¶
func GetTargets ¶
func GetTargets(targetGroup *vpclattice.TargetGroupSummary, deployment *appsv1.Deployment, env *Framework, ctx context.Context) ([]string, []*vpclattice.TargetSummary)
func NewGrpcurlRunnerPod ¶
func RandomName ¶
func RandomName() string
Types ¶
type ElasticSearchOptions ¶
type Framework ¶
type Framework struct { client.Client Log gwlog.Logger LatticeClient services.Lattice TaggingClient services.Tagging Ec2Client *ec2.EC2 GrpcurlRunner *corev1.Pod DefaultTags services.Tags Cloud anaws.Cloud // contains filtered or unexported fields }
func NewFramework ¶
func (*Framework) AreAllLatticeTargetsHealthy ¶
func (env *Framework) AreAllLatticeTargetsHealthy(ctx context.Context, tg *vpclattice.TargetGroupSummary) (bool, error)
func (*Framework) CreateServiceExport ¶
func (env *Framework) CreateServiceExport(service *v1.Service) *anv1alpha1.ServiceExport
func (*Framework) CreateServiceExportAndServiceImportByService ¶
func (env *Framework) CreateServiceExportAndServiceImportByService(service *v1.Service) (*anv1alpha1.ServiceExport, *anv1alpha1.ServiceImport)
func (*Framework) CreateServiceImport ¶
func (env *Framework) CreateServiceImport(service *v1.Service) *anv1alpha1.ServiceImport
func (*Framework) EventuallyExpectNoneFound ¶
func (env *Framework) EventuallyExpectNoneFound(ctx context.Context, objectList client.ObjectList)
func (*Framework) EventuallyExpectNotFound ¶
func (*Framework) ExpectCreated ¶
func (*Framework) ExpectDeleteAllToSucceed ¶
func (*Framework) ExpectDeleted ¶
func (*Framework) ExpectDeletedThenNotFound ¶
func (*Framework) ExpectToBeClean ¶
func (*Framework) ExpectUpdated ¶
func (*Framework) FindTargetGroupFromSpec ¶
func (env *Framework) FindTargetGroupFromSpec(ctx context.Context, tgSpec model.TargetGroupSpec) (*vpclattice.TargetGroupSummary, error)
func (*Framework) GetAllTargets ¶
func (env *Framework) GetAllTargets(ctx context.Context, targetGroup *vpclattice.TargetGroupSummary, deployment *appsv1.Deployment) ([]string, []*vpclattice.TargetSummary)
func (*Framework) GetFullTargetGroupFromSummary ¶
func (env *Framework) GetFullTargetGroupFromSummary( ctx context.Context, tgSummary *vpclattice.TargetGroupSummary) *vpclattice.GetTargetGroupOutput
func (*Framework) GetLatticeServiceHttpsListenerNonDefaultRules ¶
func (env *Framework) GetLatticeServiceHttpsListenerNonDefaultRules(ctx context.Context, vpcLatticeService *vpclattice.ServiceSummary) ([]*vpclattice.GetRuleOutput, error)
func (*Framework) GetPodsByDeploymentName ¶
func (*Framework) GetServiceNetwork ¶
func (env *Framework) GetServiceNetwork(ctx context.Context, gateway *gwv1.Gateway) *vpclattice.ServiceNetworkSummary
func (*Framework) GetTargetGroup ¶
func (env *Framework) GetTargetGroup(ctx context.Context, service *corev1.Service) *vpclattice.TargetGroupSummary
func (*Framework) GetTargetGroupWithProtocol ¶
func (env *Framework) GetTargetGroupWithProtocol(ctx context.Context, service *corev1.Service, protocol, protocolVersion string) *vpclattice.TargetGroupSummary
func (*Framework) GetTargets ¶
func (env *Framework) GetTargets(ctx context.Context, targetGroup *vpclattice.TargetGroupSummary, deployment *appsv1.Deployment) []*vpclattice.TargetSummary
TODO: Create a new function that only verifying deployment len(podList.Items)==*deployment.Spec.Replicas, and don't do lattice.ListTargets() api call
func (*Framework) GetVpcLatticeService ¶
func (env *Framework) GetVpcLatticeService(ctx context.Context, route core.Route) *vpclattice.ServiceSummary
func (*Framework) GetVpcLatticeServiceDns ¶
func (*Framework) IsVpcAssociatedWithServiceNetwork ¶
func (env *Framework) IsVpcAssociatedWithServiceNetwork(ctx context.Context, vpcId string, serviceNetwork *vpclattice.ServiceNetworkSummary) (bool, *vpclattice.ServiceNetworkVpcAssociationSummary, error)
func (*Framework) NewGRPCRoute ¶
func (*Framework) NewGateway ¶
func (*Framework) NewGrpcBin ¶
func (env *Framework) NewGrpcBin(options GrpcAppOptions) (*appsv1.Deployment, *v1.Service)
func (*Framework) NewGrpcHelloWorld ¶
func (env *Framework) NewGrpcHelloWorld(options GrpcAppOptions) (*appsv1.Deployment, *v1.Service)
https://github.com/grpc/grpc-go/tree/master/examples/helloworld
func (*Framework) NewHeaderMatchHttpRoute ¶
func (*Framework) NewHttpApp ¶
func (env *Framework) NewHttpApp(options HTTPAppOptions) (*appsv1.Deployment, *v1.Service)
func (*Framework) NewHttpRoute ¶
func (*Framework) NewMethodMatchHttpRoute ¶
func (env *Framework) NewMethodMatchHttpRoute(parentRefsGateway *gwv1.Gateway, getService *v1.Service, postService *v1.Service, httpRouteName string, namespace string) *gwv1.HTTPRoute
creates a route sending GET to getService and POST to postService
func (*Framework) NewNginxApp ¶
func (env *Framework) NewNginxApp(options ElasticSearchOptions) (*appsv1.Deployment, *v1.Service)
func (*Framework) NewPathMatchHttpRoute ¶
func (*Framework) NewTestTags ¶
func (*Framework) NewWeightedRoutingHttpRoute ¶
func (*Framework) RunGrpcurlCmd ¶
func (env *Framework) RunGrpcurlCmd(opts RunGrpcurlCmdOptions) (string, string, error)
https://github.com/fullstorydev/grpcurl https://gallery.ecr.aws/a0j4q9e4/grpcurl-runner
func (*Framework) SleepForRouteUpdate ¶
func (env *Framework) SleepForRouteUpdate()
func (*Framework) VerifyTargetGroupNotFound ¶
func (env *Framework) VerifyTargetGroupNotFound(tg *vpclattice.TargetGroupSummary)
type GrpcAppOptions ¶
type HTTPAppOptions ¶
type ObjectAndWeight ¶
type RunGrpcurlCmdOptions ¶
type TestObject ¶
type TestObject struct { Type client.Object ListType client.ObjectList }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.