Skip to content

Commit 6a90c45

Browse files
kabicinkabicin
authored andcommitted
Make kubebuilder generate DeepCopy functions
1 parent 5cf4a4b commit 6a90c45

File tree

3 files changed

+80
-13
lines changed

3 files changed

+80
-13
lines changed

common/common.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,3 @@ func GetPodSecurityContext(asc *AppSecurityContext) *corev1.PodSecurityContext {
8686
}
8787
return podSecurityContext
8888
}
89-
90-
func (in *AppSecurityContext) DeepCopy() *AppSecurityContext {
91-
if in == nil {
92-
return nil
93-
}
94-
out := new(AppSecurityContext)
95-
in.DeepCopyInto(out)
96-
return out
97-
}
98-
99-
func (in *AppSecurityContext) DeepCopyInto(out *AppSecurityContext) {
100-
*out = *in
101-
}

common/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ type BaseComponentTopologySpreadConstraints interface {
196196
}
197197

198198
// Define PodSecurityContext without overlapping fields in SecurityContext
199+
// +kubebuilder:object:generate=true
199200
type IsolatedPodSecurityContext struct {
200201
// A list of groups applied to the first process run in each container, in addition
201202
// to the container's primary GID. If unspecified, no groups will be added to
@@ -231,6 +232,7 @@ type IsolatedPodSecurityContext struct {
231232
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
232233
}
233234

235+
// +kubebuilder:object:generate=true
234236
type AppSecurityContext struct {
235237
IsolatedPodSecurityContext `json:",omitempty"`
236238
corev1.SecurityContext `json:",omitempty"`

common/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)