From c1e972ba85afce516cafe6f2362464ffc2524308 Mon Sep 17 00:00:00 2001 From: Yutaro Hayakawa Date: Wed, 22 May 2024 11:48:32 +0900 Subject: [PATCH] Generate deepCopy for RouteConfig, RDNSSConfig, and DNSSLConfig Signed-off-by: Yutaro Hayakawa --- Makefile | 5 +++- zz_generated_deepcopy.go | 55 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a9d5a95..0b49af1 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,10 @@ lint: docker run -t --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.58.0 golangci-lint run -v -D errcheck deepcopy: - go run tools/deepcopy-gen/deepcopy-gen.go Config Status InterfaceConfig InterfaceStatus PrefixConfig + go run tools/deepcopy-gen/deepcopy-gen.go \ + Config Status InterfaceConfig \ + InterfaceStatus PrefixConfig RouteConfig \ + RDNSSConfig DNSSLConfig check-deepcopy: $(MAKE) deepcopy diff --git a/zz_generated_deepcopy.go b/zz_generated_deepcopy.go index 2383ef1..e799e93 100644 --- a/zz_generated_deepcopy.go +++ b/zz_generated_deepcopy.go @@ -1,4 +1,4 @@ -// Code generated by deepcopy-gen Config Status InterfaceConfig InterfaceStatus PrefixConfig; DO NOT EDIT. +// Code generated by deepcopy-gen Config Status InterfaceConfig InterfaceStatus PrefixConfig RouteConfig RDNSSConfig DNSSLConfig; DO NOT EDIT. package ra @@ -44,6 +44,33 @@ func (o *InterfaceConfig) deepCopy() *InterfaceConfig { } } } + if o.Routes != nil { + cp.Routes = make([]*RouteConfig, len(o.Routes)) + copy(cp.Routes, o.Routes) + for i2 := range o.Routes { + if o.Routes[i2] != nil { + cp.Routes[i2] = o.Routes[i2].deepCopy() + } + } + } + if o.RDNSSes != nil { + cp.RDNSSes = make([]*RDNSSConfig, len(o.RDNSSes)) + copy(cp.RDNSSes, o.RDNSSes) + for i2 := range o.RDNSSes { + if o.RDNSSes[i2] != nil { + cp.RDNSSes[i2] = o.RDNSSes[i2].deepCopy() + } + } + } + if o.DNSSLs != nil { + cp.DNSSLs = make([]*DNSSLConfig, len(o.DNSSLs)) + copy(cp.DNSSLs, o.DNSSLs) + for i2 := range o.DNSSLs { + if o.DNSSLs[i2] != nil { + cp.DNSSLs[i2] = o.DNSSLs[i2].deepCopy() + } + } + } return &cp } @@ -66,3 +93,29 @@ func (o *PrefixConfig) deepCopy() *PrefixConfig { } return &cp } + +// deepCopy generates a deep copy of *RouteConfig +func (o *RouteConfig) deepCopy() *RouteConfig { + var cp RouteConfig = *o + return &cp +} + +// deepCopy generates a deep copy of *RDNSSConfig +func (o *RDNSSConfig) deepCopy() *RDNSSConfig { + var cp RDNSSConfig = *o + if o.Addresses != nil { + cp.Addresses = make([]string, len(o.Addresses)) + copy(cp.Addresses, o.Addresses) + } + return &cp +} + +// deepCopy generates a deep copy of *DNSSLConfig +func (o *DNSSLConfig) deepCopy() *DNSSLConfig { + var cp DNSSLConfig = *o + if o.DomainNames != nil { + cp.DomainNames = make([]string, len(o.DomainNames)) + copy(cp.DomainNames, o.DomainNames) + } + return &cp +}