Skip to content

Add e2e tests for NLB IP mode #1500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ all: controller

# Run tests
test: generate fmt vet manifests
go test ./... -coverprofile cover.out
go test ./pkg/... ./webhooks/... -coverprofile cover.out

# Build controller binary
controller: generate fmt vet
Expand Down
9 changes: 9 additions & 0 deletions pkg/aws/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type Cloud interface {
// Shield provides API to AWS Shield
Shield() services.Shield

// RGT provides API to AWS RGT
RGT() services.RGT

// Region for the kubernetes cluster
Region() string

Expand Down Expand Up @@ -80,6 +83,7 @@ func NewCloud(cfg CloudConfig, metricsRegisterer prometheus.Registerer) (Cloud,
wafv2: services.NewWAFv2(sess),
wafRegional: services.NewWAFRegional(sess, cfg.Region),
shield: services.NewShield(sess),
rgt: services.NewRGT(sess),
}, nil
}

Expand All @@ -95,6 +99,7 @@ type defaultCloud struct {
wafv2 services.WAFv2
wafRegional services.WAFRegional
shield services.Shield
rgt services.RGT
}

func (c *defaultCloud) EC2() services.EC2 {
Expand All @@ -121,6 +126,10 @@ func (c *defaultCloud) Shield() services.Shield {
return c.shield
}

func (c *defaultCloud) RGT() services.RGT {
return c.rgt
}

func (c *defaultCloud) Region() string {
return c.cfg.Region
}
Expand Down
22 changes: 22 additions & 0 deletions pkg/aws/services/rgt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package services

import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
)

type RGT interface {
resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI
}

// NewRGT constructs new RGT implementation.
func NewRGT(session *session.Session) RGT {
return &defaultRGT{
ResourceGroupsTaggingAPIAPI: resourcegroupstaggingapi.New(session),
}
}

type defaultRGT struct {
resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI
}
Loading