Skip to content

Commit d17ac14

Browse files
committed
Merge remote-tracking branch 'origin/master' into backport/37a0b07-to-master
2 parents f6cd70e + e6128ed commit d17ac14

File tree

122 files changed

+7891
-782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+7891
-782
lines changed

.github/workflows/apisix-conformance-test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ jobs:
6464
username: ${{ secrets.DOCKER_USERNAME }}
6565
password: ${{ secrets.DOCKER_PASSWORD }}
6666

67-
- name: Install kind
68-
run: |
69-
go install sigs.k8s.io/[email protected]
70-
7167
- name: Build images
7268
env:
7369
TAG: dev
@@ -85,7 +81,7 @@ jobs:
8581
8682
- name: Install And Run Cloud Provider KIND
8783
run: |
88-
go install sigs.k8s.io/cloud-provider-kind@latest
84+
go install sigs.k8s.io/cloud-provider-kind@v0.8.0
8985
nohup cloud-provider-kind > /tmp/kind-loadbalancer.log 2>&1 &
9086
9187
- name: Install Gateway API And CRDs

.github/workflows/apisix-e2e-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ jobs:
108108
node $(pwd)/adc.js -v
109109
echo "ADC_BIN=node $(pwd)/adc.js" >> $GITHUB_ENV
110110
111+
- name: Start OpenLDAP server
112+
run: make e2e-ldap
113+
111114
- name: Run E2E test suite
112115
shell: bash
113116
env:

.github/workflows/conformance-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
8787
- name: Install And Run Cloud Provider KIND
8888
run: |
89-
go install sigs.k8s.io/cloud-provider-kind@latest
89+
go install sigs.k8s.io/cloud-provider-kind@v0.8.0
9090
nohup cloud-provider-kind > /tmp/kind-loadbalancer.log 2>&1 &
9191
9292
- name: Install Gateway API And CRDs

.github/workflows/e2e-test-k8s.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ jobs:
107107
node $(pwd)/adc.js -v
108108
echo "ADC_BIN=node $(pwd)/adc.js" >> $GITHUB_ENV
109109
110+
111+
- name: Start OpenLDAP server
112+
run: make e2e-ldap
113+
110114
- name: Run E2E test suite
111115
shell: bash
112116
env:

.github/workflows/e2e-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ jobs:
107107
node $(pwd)/adc.js -v
108108
echo "ADC_BIN=node $(pwd)/adc.js" >> $GITHUB_ENV
109109
110+
- name: Start OpenLDAP server
111+
run: make e2e-ldap
112+
110113
- name: Run E2E test suite
111114
shell: bash
112115
env:

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ GO_LDFLAGS ?= "-X=$(VERSYM)=$(VERSION) -X=$(GITSHASYM)=$(GITSHA) -X=$(BUILDOSSYM
5959
# gateway-api
6060
GATEAY_API_VERSION ?= v1.3.0
6161
## https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/pkg/features/httproute.go
62-
SUPPORTED_EXTENDED_FEATURES = "HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080,HTTPRouteHostRewrite"
62+
SUPPORTED_EXTENDED_FEATURES = "HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080,HTTPRouteHostRewrite,HTTPRouteQueryParamMatching,HTTPRoutePathRewrite,HTTPRouteBackendProtocolWebSocket"
6363
CONFORMANCE_TEST_REPORT_OUTPUT ?= $(DIR)/apisix-ingress-controller-conformance-report.yaml
6464
## https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/conformance/utils/suite/profiles.go
65-
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC
65+
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC,GATEWAY-TLS
6666

6767
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6868
ifeq (,$(shell go env GOBIN))
@@ -310,6 +310,18 @@ ifndef ignore-not-found
310310
ignore-not-found = false
311311
endif
312312

313+
.PHONY: e2e-ldap
314+
e2e-ldap:
315+
ifeq ("$(E2E_FOCUS)", "")
316+
chmod +x ./test/e2e/testdata/ldap/cmd.sh && ./test/e2e/testdata/ldap/cmd.sh start
317+
endif
318+
ifneq ("$(E2E_FOCUS)", "")
319+
echo $(E2E_FOCUS) | grep -E 'suite-plugins-authentication|consumer|ldap' || exit 0 \
320+
&& chmod +x ./test/e2e/testdata/ldap/cmd.sh \
321+
&& ./test/e2e/testdata/ldap/cmd.sh start
322+
endif
323+
324+
313325
.PHONY: install-gateway-api
314326
install-gateway-api: ## Install Gateway API CRDs into the K8s cluster specified in ~/.kube/config.
315327
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/$(GATEAY_API_VERSION)/experimental-install.yaml

api/adc/types.go

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,19 @@ func (n Upstream) MarshalJSON() ([]byte, error) {
472472
return json.Marshal((Alias)(n))
473473
}
474474

475+
func ComposeSSLName(kind, namespace, name string) string {
476+
p := make([]byte, 0, len(kind)+len(namespace)+len(name)+2)
477+
buf := bytes.NewBuffer(p)
478+
479+
buf.WriteString(kind)
480+
buf.WriteByte('_')
481+
buf.WriteString(namespace)
482+
buf.WriteByte('_')
483+
buf.WriteString(name)
484+
485+
return buf.String()
486+
}
487+
475488
// ComposeRouteName uses namespace, name and rule name to compose
476489
// the route name.
477490
func ComposeRouteName(namespace, name string, rule string) string {
@@ -491,18 +504,22 @@ func ComposeRouteName(namespace, name string, rule string) string {
491504

492505
// ComposeStreamRouteName uses namespace, name and rule name to compose
493506
// the stream_route name.
494-
func ComposeStreamRouteName(namespace, name string, rule string) string {
507+
func ComposeStreamRouteName(namespace, name string, rule string, typ string) string {
508+
if typ == "" {
509+
typ = "TCP"
510+
}
495511
// FIXME Use sync.Pool to reuse this buffer if the upstream
496512
// name composing code path is hot.
497-
p := make([]byte, 0, len(namespace)+len(name)+len(rule)+6)
513+
p := make([]byte, 0, len(namespace)+len(name)+len(rule)+len(typ)+3)
498514
buf := bytes.NewBuffer(p)
499515

500516
buf.WriteString(namespace)
501517
buf.WriteByte('_')
502518
buf.WriteString(name)
503519
buf.WriteByte('_')
504520
buf.WriteString(rule)
505-
buf.WriteString("_tcp")
521+
buf.WriteByte('_')
522+
buf.WriteString(typ)
506523

507524
return buf.String()
508525
}
@@ -545,8 +562,8 @@ func ComposeServicesNameWithScheme(namespace, name string, rule string, scheme s
545562
return buf.String()
546563
}
547564

548-
func ComposeServiceNameWithStream(namespace, name string, rule string) string {
549-
return ComposeServicesNameWithScheme(namespace, name, rule, "stream")
565+
func ComposeServiceNameWithStream(namespace, name string, rule, typ string) string {
566+
return ComposeServicesNameWithScheme(namespace, name, rule, typ)
550567
}
551568

552569
func ComposeConsumerName(namespace, name string) string {

api/v2/apisixroute_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ type ApisixRouteHTTP struct {
100100

101101
// Websocket enables or disables websocket support for this route.
102102
// +kubebuilder:validation:Optional
103-
Websocket bool `json:"websocket" yaml:"websocket"`
103+
Websocket *bool `json:"websocket" yaml:"websocket"`
104104
// PluginConfigName specifies the name of the plugin config to apply.
105105
PluginConfigName string `json:"plugin_config_name,omitempty" yaml:"plugin_config_name,omitempty"`
106106
// PluginConfigNamespace specifies the namespace of the plugin config.

api/v2/apisixupstream_types.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,9 @@ type PassiveHealthCheckUnhealthy struct {
313313
// +kubebuilder:validation:Maximum=254
314314
// TCPFailures define the number of TCP failures to define an unhealthy target.
315315
TCPFailures int `json:"tcpFailures,omitempty" yaml:"tcpFailures,omitempty"`
316-
// Timeout sets health check timeout in seconds.
317-
// https://github.com/apache/apisix/blob/0151d9e35bba63d7c316187272d88e19db0be634/apisix/schema_def.lua#L196
318-
//
319316
// +kubebuilder:validation:Minimum=1
320317
// +kubebuilder:validation:Maximum=254
318+
// Timeout sets the number of timeouts to define an unhealthy target.
321319
Timeouts int `json:"timeout,omitempty" yaml:"timeout,omitempty"`
322320
}
323321

api/v2/shared_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ const (
101101
SchemeTCP = "tcp"
102102
// SchemeUDP represents the UDP protocol.
103103
SchemeUDP = "udp"
104+
// SchemeTLS represents the TLS protocol.
105+
SchemeTLS = "tls"
104106
)
105107

106108
const (

0 commit comments

Comments
 (0)