Skip to content
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 scripts/ci_e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ test_controller_image() {
CERTIFICATE_ARNS=${CERTIFICATE_ARNS:-"${CERTIFICATE_ARN_PREFIX}/${CERT_ID1},${CERTIFICATE_ARN_PREFIX}/${CERT_ID2},${CERTIFICATE_ARN_PREFIX}/${CERT_ID3}"}
echo "creating s3 bucket $S3_BUCKET"
aws s3api create-bucket --bucket $S3_BUCKET --region $AWS_REGION --create-bucket-configuration LocationConstraint=$AWS_REGION || true
ginkgo -timeout 3h -v -r test/e2e -- \
ginkgo -timeout 3h -v -p -r test/e2e -- \
--kubeconfig=${CLUSTER_KUBECONFIG} \
--cluster-name=${CLUSTER_NAME} \
--aws-region=${AWS_REGION} \
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/gateway/alb_resource_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func (s *albResourceStack) Deploy(ctx context.Context, f *framework.Framework) e
}

func (s *albResourceStack) Cleanup(ctx context.Context, f *framework.Framework) error {
if s == nil || s.commonStack == nil {
return nil
}
if err := s.commonStack.Cleanup(ctx, f); err != nil {
return err
}
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/gateway/alb_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func (s *ALBTestStack) deploy(ctx context.Context, f *framework.Framework, gwLis
}

func (s *ALBTestStack) Cleanup(ctx context.Context, f *framework.Framework) error {
if s.albResourceStack == nil {
return nil
}
return s.albResourceStack.Cleanup(ctx, f)
}

Expand Down
3 changes: 3 additions & 0 deletions test/e2e/gateway/nlb_resource_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func (s *nlbResourceStack) Deploy(ctx context.Context, f *framework.Framework) e
}

func (s *nlbResourceStack) Cleanup(ctx context.Context, f *framework.Framework) error {
if s == nil || s.commonStack == nil {
return nil
}
return s.commonStack.Cleanup(ctx, f)
}

Expand Down
3 changes: 3 additions & 0 deletions test/e2e/gateway/nlb_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ func (s *NLBTestStack) CreateFENLBReferenceGrant(ctx context.Context, f *framewo
}

func (s *NLBTestStack) Cleanup(ctx context.Context, f *framework.Framework) error {
if s.nlbResourceStack == nil {
return nil
}
return s.nlbResourceStack.Cleanup(ctx, f)
}

Expand Down
14 changes: 12 additions & 2 deletions test/e2e/ingress/ingress_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
. "github.com/onsi/gomega"
framework "sigs.k8s.io/aws-load-balancer-controller/test/framework"
"testing"
"time"
)

var tf *framework.Framework
Expand All @@ -14,10 +15,19 @@ func TestIngress(t *testing.T) {
RunSpecs(t, "Ingress Suite")
}

var _ = BeforeSuite(func() {
var _ = SynchronizedBeforeSuite(func() []byte {
var err error

tf, err = framework.InitFramework()
Expect(err).NotTo(HaveOccurred())

if tf.Options.ControllerImage != "" {
err = tf.CTRLInstallationManager.UpgradeController(tf.Options.ControllerImage, true, true)
Expect(err).NotTo(HaveOccurred())
time.Sleep(60 * time.Second)
}
return nil
}, func(data []byte) {
var err error
tf, err = framework.InitFramework()
Expect(err).NotTo(HaveOccurred())
})
8 changes: 0 additions & 8 deletions test/e2e/ingress/multi_path_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ var _ = Describe("test ingresses with multiple path and backends", func() {

BeforeEach(func() {
ctx = context.Background()

if tf.Options.ControllerImage != "" {
By(fmt.Sprintf("ensure cluster installed with controller: %s", tf.Options.ControllerImage), func() {
err := tf.CTRLInstallationManager.UpgradeController(tf.Options.ControllerImage, false, false)
Expect(err).NotTo(HaveOccurred())
time.Sleep(60 * time.Second)
})
}
})

AfterEach(func() {
Expand Down
11 changes: 0 additions & 11 deletions test/e2e/ingress/target_control_port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net/http"
"strings"
"time"

awssdk "github.com/aws/aws-sdk-go-v2/aws"
"github.com/gavv/httpexpect/v2"
Expand Down Expand Up @@ -40,16 +39,6 @@ var _ = Describe("ALB target control agent injection and target control port tes

BeforeEach(func() {
ctx = context.Background()
if tf.Options.ControllerImage != "" {
By("upgrade controller with ALBTargetControlAgent enabled", func() {
tf.Logger.Info("Starting controller upgrade", "image", tf.Options.ControllerImage)
err := tf.CTRLInstallationManager.UpgradeController(tf.Options.ControllerImage, false, true)
Expect(err).NotTo(HaveOccurred())
tf.Logger.Info("Controller upgrade completed, waiting for rollout")
time.Sleep(60 * time.Second)
tf.Logger.Info("Controller should be ready now")
})
}
By("setup sandbox namespace", func() {
tf.Logger.Info("allocating namespace")
ns, err := tf.NSManager.AllocateNamespace(ctx, "alb-target-control-e2e")
Expand Down
17 changes: 0 additions & 17 deletions test/e2e/ingress/vanilla_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ var _ = Describe("vanilla ingress tests", func() {

BeforeEach(func() {
ctx = context.Background()
if tf.Options.ControllerImage != "" {
By(fmt.Sprintf("ensure cluster installed with controller: %s", tf.Options.ControllerImage), func() {
err := tf.CTRLInstallationManager.UpgradeController(tf.Options.ControllerImage, false, false)
Expect(err).NotTo(HaveOccurred())
time.Sleep(60 * time.Second)
})
}

By("setup sandbox namespace", func() {
tf.Logger.Info("allocating namespace")
Expand Down Expand Up @@ -434,16 +427,6 @@ var _ = Describe("vanilla ingress tests", func() {
})

Context("with ALB IP targets, named target port and endPointSlices enabled", func() {
BeforeEach(func() {
ctx = context.Background()
if tf.Options.ControllerImage != "" {
By(fmt.Sprintf("upgrade controller with endPointSlices enabled."), func() {
err := tf.CTRLInstallationManager.UpgradeController(tf.Options.ControllerImage, true, false)
Expect(err).NotTo(HaveOccurred())
time.Sleep(60 * time.Second)
})
}
})
It("with 'alb.ingress.kubernetes.io/target-type' annotation explicitly specified, and endPointSlices enabled, one ALB shall be created and functional", func() {
appBuilder := manifest.NewFixedResponseServiceBuilder().WithTargetPortName("e2e-targetport")
ingBuilder := manifest.NewIngressBuilder()
Expand Down
Loading