Skip to content

Commit

Permalink
Add another https listener in the gateway.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Zijun Wang committed Apr 25, 2023
1 parent d9c26ab commit f4d4e60
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin
export CLUSTER_NAME ?= $(shell kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev | cut -d"." -f1)
export CLUSTER_VPC_ID ?= $(shell aws eks describe-cluster --name $(CLUSTER_NAME) | jq -r ".cluster.resourcesVpcConfig.vpcId")
export AWS_ACCOUNT_ID ?= $(shell aws sts get-caller-identity --query Account --output text)
export GATEWAY_API_CONTROLLER_LOGLEVEL ?= dubug
export GATEWAY_API_CONTROLLER_LOGLEVEL ?= debug
export REGION ?= us-west-2

# Image URL to use all building/pushing image targets
Expand Down
7 changes: 6 additions & 1 deletion test/pkg/test/http_gateway.go → test/pkg/test/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sigs.k8s.io/gateway-api/apis/v1beta1"
)

func (env *Framework) NewHttpGateway() *v1beta1.Gateway {
func (env *Framework) NewGateway() *v1beta1.Gateway {
gateway := New(
&v1beta1.Gateway{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -21,6 +21,11 @@ func (env *Framework) NewHttpGateway() *v1beta1.Gateway {
Protocol: v1beta1.HTTPProtocolType,
Port: 80,
},
{
Name: "https",
Protocol: v1beta1.HTTPSProtocolType,
Port: 443,
},
},
},
Status: v1beta1.GatewayStatus{},
Expand Down
2 changes: 1 addition & 1 deletion test/pkg/test/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func RandomName() string {
sequentialNumberLock.Lock()
defer sequentialNumberLock.Unlock()
sequentialNumber++
return strings.ToLower(fmt.Sprintf("%s-%d-%s", randomdata.Alphanumeric(5), sequentialNumber, randomdata.Alphanumeric(10)))
return strings.ToLower(fmt.Sprintf("%s-%d-%s", randomdata.SillyName()[:5], sequentialNumber, randomdata.Alphanumeric(10)))
}
2 changes: 1 addition & 1 deletion test/suites/integration/httproute_header_match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var _ = Describe("HTTPRoute header matches", func() {
It("Create a HttpRoute with a header match rule, http traffic should work if pass the correct headers", func() {
gateway := testFramework.NewHttpGateway()
gateway := testFramework.NewGateway()

deployment3, service3 := testFramework.NewHttpApp(test.HTTPAppOptions{Name: "test-v3"})
headerMatchHttpRoute := testFramework.NewHeaderMatchHttpRoute(gateway, []*v1.Service{service3})
Expand Down
2 changes: 1 addition & 1 deletion test/suites/integration/httproute_path_match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var _ = Describe("HTTPRoute path matches", func() {
It("HTTPRoute should support multiple path matches", func() {
gateway := testFramework.NewHttpGateway()
gateway := testFramework.NewGateway()
deployment1, service1 := testFramework.NewHttpApp(test.HTTPAppOptions{Name: "test-v1"})
deployment2, service2 := testFramework.NewHttpApp(test.HTTPAppOptions{Name: "test-v2"})
pathMatchHttpRoute := testFramework.NewPathMatchHttpRoute(gateway, []client.Object{service1, service2}, "http")
Expand Down

0 comments on commit f4d4e60

Please sign in to comment.