From 7fa9012d1f56c8b15599fd8557a53dd66bac29c6 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 10 Nov 2023 14:47:39 -0500 Subject: [PATCH] OCPBUGS-15934: use *resource.Quantity to not automatically set 0 Signed-off-by: Qi Wang --- machineconfiguration/v1/types.go | 4 ++-- machineconfiguration/v1/zz_generated.deepcopy.go | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/machineconfiguration/v1/types.go b/machineconfiguration/v1/types.go index 0ffe33e481f..92656a544b0 100644 --- a/machineconfiguration/v1/types.go +++ b/machineconfiguration/v1/types.go @@ -679,12 +679,12 @@ type ContainerRuntimeConfiguration struct { // Negative numbers indicate that no size limit is imposed. // If it is positive, it must be >= 8192 to match/exceed conmon's read buffer. // +optional - LogSizeMax resource.Quantity `json:"logSizeMax,omitempty"` + LogSizeMax *resource.Quantity `json:"logSizeMax,omitempty"` // overlaySize specifies the maximum size of a container image. // This flag can be used to set quota on the size of container images. (default: 10GB) // +optional - OverlaySize resource.Quantity `json:"overlaySize,omitempty"` + OverlaySize *resource.Quantity `json:"overlaySize,omitempty"` // defaultRuntime is the name of the OCI runtime to be used as the default. // +optional diff --git a/machineconfiguration/v1/zz_generated.deepcopy.go b/machineconfiguration/v1/zz_generated.deepcopy.go index 25fc281146f..180027a84e4 100644 --- a/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/machineconfiguration/v1/zz_generated.deepcopy.go @@ -168,8 +168,16 @@ func (in *ContainerRuntimeConfiguration) DeepCopyInto(out *ContainerRuntimeConfi *out = new(int64) **out = **in } - out.LogSizeMax = in.LogSizeMax.DeepCopy() - out.OverlaySize = in.OverlaySize.DeepCopy() + if in.LogSizeMax != nil { + in, out := &in.LogSizeMax, &out.LogSizeMax + x := (*in).DeepCopy() + *out = &x + } + if in.OverlaySize != nil { + in, out := &in.OverlaySize, &out.OverlaySize + x := (*in).DeepCopy() + *out = &x + } return }