From ed79c60e7830b04784d831ffab3a433cdd763a9f Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Fri, 8 Sep 2023 16:09:44 -0400 Subject: [PATCH] NET-5530 Generate deep-copy code (#18730) * Generate deep-copy code * Undo license header removal --- agent/structs/structs.deepcopy.go | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/agent/structs/structs.deepcopy.go b/agent/structs/structs.deepcopy.go index 0434ba1e67..8a2b95f296 100644 --- a/agent/structs/structs.deepcopy.go +++ b/agent/structs/structs.deepcopy.go @@ -424,6 +424,28 @@ func (o *HTTPRouteConfigEntry) DeepCopy() *HTTPRouteConfigEntry { if o.Rules[i2].Filters.JWT != nil { cp.Rules[i2].Filters.JWT = o.Rules[i2].Filters.JWT.DeepCopy() } + if o.Rules[i2].ResponseFilters.Headers != nil { + cp.Rules[i2].ResponseFilters.Headers = make([]HTTPHeaderFilter, len(o.Rules[i2].ResponseFilters.Headers)) + copy(cp.Rules[i2].ResponseFilters.Headers, o.Rules[i2].ResponseFilters.Headers) + for i5 := range o.Rules[i2].ResponseFilters.Headers { + if o.Rules[i2].ResponseFilters.Headers[i5].Add != nil { + cp.Rules[i2].ResponseFilters.Headers[i5].Add = make(map[string]string, len(o.Rules[i2].ResponseFilters.Headers[i5].Add)) + for k7, v7 := range o.Rules[i2].ResponseFilters.Headers[i5].Add { + cp.Rules[i2].ResponseFilters.Headers[i5].Add[k7] = v7 + } + } + if o.Rules[i2].ResponseFilters.Headers[i5].Remove != nil { + cp.Rules[i2].ResponseFilters.Headers[i5].Remove = make([]string, len(o.Rules[i2].ResponseFilters.Headers[i5].Remove)) + copy(cp.Rules[i2].ResponseFilters.Headers[i5].Remove, o.Rules[i2].ResponseFilters.Headers[i5].Remove) + } + if o.Rules[i2].ResponseFilters.Headers[i5].Set != nil { + cp.Rules[i2].ResponseFilters.Headers[i5].Set = make(map[string]string, len(o.Rules[i2].ResponseFilters.Headers[i5].Set)) + for k7, v7 := range o.Rules[i2].ResponseFilters.Headers[i5].Set { + cp.Rules[i2].ResponseFilters.Headers[i5].Set[k7] = v7 + } + } + } + } if o.Rules[i2].Matches != nil { cp.Rules[i2].Matches = make([]HTTPMatch, len(o.Rules[i2].Matches)) copy(cp.Rules[i2].Matches, o.Rules[i2].Matches) @@ -495,6 +517,28 @@ func (o *HTTPRouteConfigEntry) DeepCopy() *HTTPRouteConfigEntry { if o.Rules[i2].Services[i4].Filters.JWT != nil { cp.Rules[i2].Services[i4].Filters.JWT = o.Rules[i2].Services[i4].Filters.JWT.DeepCopy() } + if o.Rules[i2].Services[i4].ResponseFilters.Headers != nil { + cp.Rules[i2].Services[i4].ResponseFilters.Headers = make([]HTTPHeaderFilter, len(o.Rules[i2].Services[i4].ResponseFilters.Headers)) + copy(cp.Rules[i2].Services[i4].ResponseFilters.Headers, o.Rules[i2].Services[i4].ResponseFilters.Headers) + for i7 := range o.Rules[i2].Services[i4].ResponseFilters.Headers { + if o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Add != nil { + cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Add = make(map[string]string, len(o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Add)) + for k9, v9 := range o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Add { + cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Add[k9] = v9 + } + } + if o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Remove != nil { + cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Remove = make([]string, len(o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Remove)) + copy(cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Remove, o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Remove) + } + if o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Set != nil { + cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Set = make(map[string]string, len(o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Set)) + for k9, v9 := range o.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Set { + cp.Rules[i2].Services[i4].ResponseFilters.Headers[i7].Set[k9] = v9 + } + } + } + } } } }