Skip to content

Commit e064fe1

Browse files
committed
BUILD/MEDIUM: deps: update client-native to v6.4.2
The models package no longer ships hand-written compare helpers: Equal and Diff methods are now generated by go-method-gen and take GoMethodGenOptions instead of the removed models.Options. NilSameAsEmpty is gone; treating nil as empty is the new default, so the explicit option was dropped. Two behavioral changes required adjustments: - BindParams lost its Name field, which moved to the parent Bind struct, so bind literals in handlers, gateways and controller were restructured. - The generated Diff no longer treats nil as equal to an empty struct pointer. Empty TuneOptions/TuneSslOptions injected by the controller are not persisted in the config file, so they kept re-appearing as a diff and caused a reload on every sync. Both sides are now normalized to nil when empty before diffing. The CR tests had to follow the API changes: ACL parsing returns models.ACL with an ACLName field instead of types.ACL, and the CR deploy fixtures lost the removed http-use-htx and http_proxy fields. The backend CRD is the only one rewritten by yq, and the CI image ships a yq whose emitter keeps long single-line descriptions on one line, while newer local yq versions re-fold them at 80 columns. The CRDs are committed with the folding as produced by the CI toolchain. Regenerated the v3 CRDs, which drops two options removed from client-native (http-use-htx and http_proxy, both deprecated HAProxy settings) and adds the new v6.4.2 fields; everything else is additive.
1 parent bf02083 commit e064fe1

28 files changed

Lines changed: 1355 additions & 228 deletions

crs/api/ingress/v1/tcp.go

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200,39 +200,27 @@ func (a TCPModel) Equal(b TCPModel, opt ...models.Options) bool {
200200
}
201201
}
202202

203-
if !a.Frontend.Acls.Equal(b.Frontend.Acls, models.Options{
204-
NilSameAsEmpty: true,
205-
}) {
203+
if !a.Frontend.Acls.Equal(b.Frontend.Acls) {
206204
return false
207205
}
208206

209-
if !a.Frontend.BackendSwitchingRules.Equal(b.Frontend.BackendSwitchingRules, models.Options{
210-
NilSameAsEmpty: true,
211-
}) {
207+
if !a.Frontend.BackendSwitchingRules.Equal(b.Frontend.BackendSwitchingRules) {
212208
return false
213209
}
214210

215-
if !a.Frontend.Captures.Equal(b.Frontend.Captures, models.Options{
216-
NilSameAsEmpty: true,
217-
}) {
211+
if !a.Frontend.Captures.Equal(b.Frontend.Captures) {
218212
return false
219213
}
220214

221-
if !a.Frontend.Filters.Equal(b.Frontend.Filters, models.Options{
222-
NilSameAsEmpty: true,
223-
}) {
215+
if !a.Frontend.Filters.Equal(b.Frontend.Filters) {
224216
return false
225217
}
226218

227-
if !a.Frontend.LogTargets.Equal(b.Frontend.LogTargets, models.Options{
228-
NilSameAsEmpty: true,
229-
}) {
219+
if !a.Frontend.LogTargets.Equal(b.Frontend.LogTargets) {
230220
return false
231221
}
232222

233-
if !a.Frontend.TCPRequestRules.Equal(b.Frontend.TCPRequestRules, models.Options{
234-
NilSameAsEmpty: true,
235-
}) {
223+
if !a.Frontend.TCPRequestRules.Equal(b.Frontend.TCPRequestRules) {
236224
return false
237225
}
238226

crs/api/ingress/v3/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
// +genclient
2424
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25-
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.2.4"
25+
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.4.2"
2626

2727
// Backend is a specification for a Backend resource
2828
type Backend struct {

crs/api/ingress/v3/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
// +genclient
2424
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25-
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.2.4"
25+
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.4.2"
2626

2727
// Defaults is a specification for a Defaults resource
2828
type Defaults struct {

crs/api/ingress/v3/frontend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
// +genclient
2424
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25-
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.2.4"
25+
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.4.2"
2626

2727
// Frontend is a specification for a Frontend resource
2828
type Frontend struct {

crs/api/ingress/v3/global.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
// +genclient
2424
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
25-
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.2.4"
25+
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.4.2"
2626
// +kubebuilder:validation:XValidation:rule="!has(self.spec.default_path)", message="spec.config.default_path is set by ingress controller internally"
2727
// +kubebuilder:validation:XValidation:rule="!has(self.spec.master__dash__worker)", message="spec.config.master-worker is set by ingress controller internally"
2828
// +kubebuilder:validation:XValidation:rule="!has(self.spec.pidfile)", message="spec.config.pidfile is set by ingress controller internally"

crs/api/ingress/v3/tcp.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ package v3
1818
import (
1919
"github.com/go-openapi/swag/jsonutils"
2020
"github.com/haproxytech/client-native/v6/models"
21+
"github.com/haproxytech/go-method-gen/pkg/eqdiff"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2223
)
2324

2425
// +genclient
2526
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
26-
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.2.4"
27+
// +kubebuilder:metadata:annotations="haproxy.org/client-native=v6.4.2"
2728

2829
// TCP is a specification for a TCP resource
2930
type TCP struct {
@@ -100,7 +101,7 @@ func (s *TCPService) UnmarshalBinary(b []byte) error {
100101
return nil
101102
}
102103

103-
func (a TCPModel) Equal(b TCPModel, opt ...models.Options) bool {
104+
func (a TCPModel) Equal(b TCPModel, opt ...eqdiff.GoMethodGenOptions) bool {
104105
if a.Name != b.Name {
105106
return false
106107
}
@@ -134,6 +135,6 @@ func (a TCPModel) Equal(b TCPModel, opt ...models.Options) bool {
134135
return true
135136
}
136137

137-
func (s TCPService) Equal(b TCPService, opt ...models.Options) bool {
138+
func (s TCPService) Equal(b TCPService, opt ...eqdiff.GoMethodGenOptions) bool {
138139
return s.Name == b.Name && s.Port == b.Port
139140
}

0 commit comments

Comments
 (0)