Skip to content

Commit

Permalink
Make kubebuilder generate DeepCopy functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kabicin authored and kabicin committed Feb 7, 2024
1 parent 5cf4a4b commit 6a90c45
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 13 deletions.
13 changes: 0 additions & 13 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,3 @@ func GetPodSecurityContext(asc *AppSecurityContext) *corev1.PodSecurityContext {
}
return podSecurityContext
}

func (in *AppSecurityContext) DeepCopy() *AppSecurityContext {
if in == nil {
return nil
}
out := new(AppSecurityContext)
in.DeepCopyInto(out)
return out
}

func (in *AppSecurityContext) DeepCopyInto(out *AppSecurityContext) {
*out = *in
}
2 changes: 2 additions & 0 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ type BaseComponentTopologySpreadConstraints interface {
}

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

// +kubebuilder:object:generate=true
type AppSecurityContext struct {
IsolatedPodSecurityContext `json:",omitempty"`
corev1.SecurityContext `json:",omitempty"`
Expand Down
78 changes: 78 additions & 0 deletions common/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a90c45

Please sign in to comment.