From b7da97a89c9f1e0d0b4da2be5cc6910a428de822 Mon Sep 17 00:00:00 2001 From: "gang.liu" Date: Thu, 8 Aug 2024 18:23:20 +0800 Subject: [PATCH 1/4] add changelog Signed-off-by: gang.liu --- changelogs/unreleased/6604-izturn-minor.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/6604-izturn-minor.md diff --git a/changelogs/unreleased/6604-izturn-minor.md b/changelogs/unreleased/6604-izturn-minor.md new file mode 100644 index 00000000000..152fb070292 --- /dev/null +++ b/changelogs/unreleased/6604-izturn-minor.md @@ -0,0 +1,4 @@ + +## Customize the certificate's lifetime + +customize the number of days for which certificates will be valid. defaults to 365. \ No newline at end of file From b3387b0db049c7f6878fc7bca48c4e375e29cee6 Mon Sep 17 00:00:00 2001 From: "gang.liu" Date: Tue, 27 Aug 2024 16:18:15 +0800 Subject: [PATCH 2/4] fix lb address Signed-off-by: gang.liu --- internal/dag/gatewayapi_processor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/dag/gatewayapi_processor.go b/internal/dag/gatewayapi_processor.go index 96bc3c61103..64a80ce4757 100644 --- a/internal/dag/gatewayapi_processor.go +++ b/internal/dag/gatewayapi_processor.go @@ -413,7 +413,9 @@ func (l *listenerInfo) AllowsKind(kind gatewayapi_v1.Kind) bool { // isAddressAssigned returns true if either there are no addresses requested in specAddresses, // or if at least one address from specAddresses appears in statusAddresses. func isAddressAssigned(specAddresses []gatewayapi_v1.GatewayAddress, statusAddresses []gatewayapi_v1.GatewayStatusAddress) bool { - if len(specAddresses) == 0 { + // 1. no addresses requested in specAddresses + // 2. at least one address in specAddresses but no address in statusAddresses at the moment. + if len(specAddresses) == 0 || len(statusAddresses) == 0 { return true } From a0d15c92ba1c2ad285c42b3cf1a22f8b694866f4 Mon Sep 17 00:00:00 2001 From: "gang.liu" Date: Tue, 27 Aug 2024 17:21:10 +0800 Subject: [PATCH 3/4] fix ut Signed-off-by: gang.liu --- internal/dag/builder_test.go | 8 ++++++++ internal/dag/status_test.go | 7 +++++++ internal/k8s/statusaddress.go | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/dag/builder_test.go b/internal/dag/builder_test.go index 70f9ee3ed0f..882ae4588d7 100644 --- a/internal/dag/builder_test.go +++ b/internal/dag/builder_test.go @@ -266,6 +266,14 @@ func TestDAGInsertGatewayAPI(t *testing.T) { }, }}, }, + Status: gatewayapi_v1.GatewayStatus{ + Addresses: []gatewayapi_v1.GatewayStatusAddress{ + { + Type: ptr.To(gatewayapi_v1.IPAddressType), + Value: "1.2.3.5", + }, + }, + }, } gatewayTLSPassthroughAllNamespaces := &gatewayapi_v1.Gateway{ diff --git a/internal/dag/status_test.go b/internal/dag/status_test.go index cefc5a79836..6878f675719 100644 --- a/internal/dag/status_test.go +++ b/internal/dag/status_test.go @@ -8576,6 +8576,13 @@ func TestGatewayAPIHTTPRouteDAGStatus(t *testing.T) { }, }}, }, + Status: gatewayapi_v1.GatewayStatus{ + Addresses: []gatewayapi_v1.GatewayStatusAddress{ + { + Value: "1.2.3.5", + }, + }, + }, }, wantGatewayStatusUpdate: []*status.GatewayStatusUpdate{{ FullName: types.NamespacedName{Namespace: "projectcontour", Name: "contour"}, diff --git a/internal/k8s/statusaddress.go b/internal/k8s/statusaddress.go index 0cb5cc1daa2..7f32eaa4f85 100644 --- a/internal/k8s/statusaddress.go +++ b/internal/k8s/statusaddress.go @@ -143,7 +143,7 @@ func (s *StatusAddressUpdater) OnAdd(obj any, _ bool) { } } - s.StatusUpdater.Send(NewStatusUpdate( + s.StatusUpdater.中end(NewStatusUpdate( o.Name, o.Namespace, &gatewayapi_v1.Gateway{}, From 73744fd09f2ecf8df26a4c7b1404a84c24117a66 Mon Sep 17 00:00:00 2001 From: "gang.liu" Date: Tue, 27 Aug 2024 17:32:04 +0800 Subject: [PATCH 4/4] revert wrong file Signed-off-by: gang.liu --- changelogs/unreleased/6604-izturn-minor.md | 4 ---- internal/k8s/statusaddress.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 changelogs/unreleased/6604-izturn-minor.md diff --git a/changelogs/unreleased/6604-izturn-minor.md b/changelogs/unreleased/6604-izturn-minor.md deleted file mode 100644 index 152fb070292..00000000000 --- a/changelogs/unreleased/6604-izturn-minor.md +++ /dev/null @@ -1,4 +0,0 @@ - -## Customize the certificate's lifetime - -customize the number of days for which certificates will be valid. defaults to 365. \ No newline at end of file diff --git a/internal/k8s/statusaddress.go b/internal/k8s/statusaddress.go index 7f32eaa4f85..0cb5cc1daa2 100644 --- a/internal/k8s/statusaddress.go +++ b/internal/k8s/statusaddress.go @@ -143,7 +143,7 @@ func (s *StatusAddressUpdater) OnAdd(obj any, _ bool) { } } - s.StatusUpdater.中end(NewStatusUpdate( + s.StatusUpdater.Send(NewStatusUpdate( o.Name, o.Namespace, &gatewayapi_v1.Gateway{},