Skip to content

Commit 069ba9b

Browse files
authored
Add e2e tests for NLB IP mode (kubernetes-sigs#1500)
* e2e tests for k8s service - Add support for e2e testing of AWS NLB in IP mode - Verify target group health check config - Test NLB access-log annotations - Test TLS annotations - Traffic tests * separate e2e tests from Makefile target
1 parent b0f4021 commit 069ba9b

File tree

9 files changed

+774
-2
lines changed

9 files changed

+774
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ all: controller
1515

1616
# Run tests
1717
test: generate fmt vet manifests
18-
go test ./... -coverprofile cover.out
18+
go test ./pkg/... ./webhooks/... -coverprofile cover.out
1919

2020
# Build controller binary
2121
controller: generate fmt vet

pkg/aws/cloud.go

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ type Cloud interface {
3030
// Shield provides API to AWS Shield
3131
Shield() services.Shield
3232

33+
// RGT provides API to AWS RGT
34+
RGT() services.RGT
35+
3336
// Region for the kubernetes cluster
3437
Region() string
3538

@@ -80,6 +83,7 @@ func NewCloud(cfg CloudConfig, metricsRegisterer prometheus.Registerer) (Cloud,
8083
wafv2: services.NewWAFv2(sess),
8184
wafRegional: services.NewWAFRegional(sess, cfg.Region),
8285
shield: services.NewShield(sess),
86+
rgt: services.NewRGT(sess),
8387
}, nil
8488
}
8589

@@ -95,6 +99,7 @@ type defaultCloud struct {
9599
wafv2 services.WAFv2
96100
wafRegional services.WAFRegional
97101
shield services.Shield
102+
rgt services.RGT
98103
}
99104

100105
func (c *defaultCloud) EC2() services.EC2 {
@@ -121,6 +126,10 @@ func (c *defaultCloud) Shield() services.Shield {
121126
return c.shield
122127
}
123128

129+
func (c *defaultCloud) RGT() services.RGT {
130+
return c.rgt
131+
}
132+
124133
func (c *defaultCloud) Region() string {
125134
return c.cfg.Region
126135
}

pkg/aws/services/rgt.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package services
2+
3+
import (
4+
"github.com/aws/aws-sdk-go/aws/session"
5+
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
6+
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
7+
)
8+
9+
type RGT interface {
10+
resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI
11+
}
12+
13+
// NewRGT constructs new RGT implementation.
14+
func NewRGT(session *session.Session) RGT {
15+
return &defaultRGT{
16+
ResourceGroupsTaggingAPIAPI: resourcegroupstaggingapi.New(session),
17+
}
18+
}
19+
20+
type defaultRGT struct {
21+
resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI
22+
}

0 commit comments

Comments
 (0)