Skip to content

Commit 8ccbf40

Browse files
committed
Add generated DeepCopy implementations for pkg/types/installconfig
1 parent 1dacae5 commit 8ccbf40

Some content is hidden

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

67 files changed

+9459
-1
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ require (
132132
k8s.io/apimachinery v0.34.1
133133
k8s.io/client-go v0.34.1
134134
k8s.io/cloud-provider-vsphere v1.31.0
135+
k8s.io/code-generator v0.34.1
135136
k8s.io/klog v1.0.0
136137
k8s.io/klog/v2 v2.130.1
137138
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
@@ -347,6 +348,7 @@ require (
347348
k8s.io/cli-runtime v0.33.4 // indirect
348349
k8s.io/cluster-bootstrap v0.33.3 // indirect
349350
k8s.io/component-base v0.34.1 // indirect
351+
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect
350352
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
351353
k8s.io/kubectl v0.33.4 // indirect
352354
sigs.k8s.io/kustomize/api v0.19.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,10 +1172,14 @@ k8s.io/client-go v0.34.1/go.mod h1:kA8v0FP+tk6sZA0yKLRG67LWjqufAoSHA2xVGKw9Of8=
11721172
k8s.io/cluster-bootstrap v0.33.3 h1:u2NTxJ5CFSBFXaDxLQoOWMly8eni31psVso+caq6uwI=
11731173
k8s.io/cluster-bootstrap v0.33.3/go.mod h1:p970f8u8jf273zyQ5raD8WUu2XyAl0SAWOY82o7i/ds=
11741174
k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
1175+
k8s.io/code-generator v0.34.1 h1:WpphT26E+j7tEgIUfFr5WfbJrktCGzB3JoJH9149xYc=
1176+
k8s.io/code-generator v0.34.1/go.mod h1:DeWjekbDnJWRwpw3s0Jat87c+e0TgkxoR4ar608yqvg=
11751177
k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A=
11761178
k8s.io/component-base v0.34.1/go.mod h1:mknCpLlTSKHzAQJJnnHVKqjxR7gBeHRv0rPXA7gdtQ0=
11771179
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
11781180
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
1181+
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f h1:SLb+kxmzfA87x4E4brQzB33VBbT2+x7Zq9ROIHmGn9Q=
1182+
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU=
11791183
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
11801184
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
11811185
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=

pkg/ipnet/ipnet.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,22 @@ func MustParseCIDR(s string) *IPNet {
9595
}
9696
return cidr
9797
}
98+
99+
// DeepCopyInto copies the receiver into out. out must be non-nil.
100+
func (ipnet *IPNet) DeepCopyInto(out *IPNet) {
101+
if ipnet == nil {
102+
*out = IPNet{}
103+
} else {
104+
*out = *ipnet
105+
}
106+
}
107+
108+
// DeepCopy copies the receiver, creating a new IPNet.
109+
func (ipnet *IPNet) DeepCopy() *IPNet {
110+
if ipnet == nil {
111+
return nil
112+
}
113+
out := new(IPNet)
114+
ipnet.DeepCopyInto(out)
115+
return out
116+
}

pkg/ipnet/ipnet_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,36 @@ func TestUnmarshal(t *testing.T) {
5656
})
5757
}
5858
}
59+
60+
func TestDeepCopy(t *testing.T) {
61+
for _, ipNetIn := range []*IPNet{
62+
{},
63+
{IPNet: net.IPNet{
64+
IP: net.IP{192, 168, 0, 10},
65+
Mask: net.IPv4Mask(255, 255, 255, 0),
66+
}},
67+
} {
68+
t.Run(ipNetIn.String(), func(t *testing.T) {
69+
t.Run("DeepCopyInto", func(t *testing.T) {
70+
ipNetOut := &IPNet{}
71+
ipNetIn.DeepCopyInto(ipNetOut)
72+
if ipNetOut.String() != ipNetIn.String() {
73+
t.Fatalf("%v != %v", ipNetOut, ipNetIn)
74+
}
75+
if ipNetOut == ipNetIn {
76+
t.Fatalf("DeepCopyInto did not deep copy (pointers are equal)")
77+
}
78+
})
79+
80+
t.Run("DeepCopy", func(t *testing.T) {
81+
ipNetOut := ipNetIn.DeepCopy()
82+
if ipNetOut.String() != ipNetIn.String() {
83+
t.Fatalf("%v != %v", ipNetOut, ipNetIn)
84+
}
85+
if ipNetOut == ipNetIn {
86+
t.Fatalf("DeepCopy did not deep copy (pointers are equal)")
87+
}
88+
})
89+
})
90+
}
91+
}

pkg/types/aws/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Package aws contains AWS-specific structures for installer
22
// configuration and management.
3+
// +k8s:deepcopy-gen=package
34
package aws
45

56
// Name is name for the AWS platform.

pkg/types/aws/zz_generated.deepcopy.go

Lines changed: 215 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/types/azure/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Package azure contains Azure-specific structures for installer
22
// configuration and management.
3+
// +k8s:deepcopy-gen=package
34
package azure
45

56
// Name is the name for the Azure platform.

0 commit comments

Comments
 (0)