Merge pull request #25755 from kolyshkin/unused2

Remove unused code and data structures
This commit is contained in:
openshift-merge-bot[bot] 2025-04-09 18:58:43 +00:00 committed by GitHub
commit 4aeca9cced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 25 deletions

View File

@ -291,22 +291,16 @@ type PodCreateReport = types.PodCreateReport
type PodCloneReport = types.PodCloneReport
func (p *PodCreateOptions) CPULimits() *specs.LinuxCPU {
cpu := &specs.LinuxCPU{}
hasLimits := false
cpu := &specs.LinuxCPU{
Cpus: p.CpusetCpus,
}
if p.Cpus != 0 {
period, quota := util.CoresToPeriodAndQuota(p.Cpus)
cpu.Period = &period
cpu.Quota = &quota
hasLimits = true
}
if p.CpusetCpus != "" {
cpu.Cpus = p.CpusetCpus
hasLimits = true
}
if !hasLimits {
return cpu
}
return cpu
}
@ -380,18 +374,11 @@ func ToPodSpecGen(s specgen.PodSpecGenerator, p *PodCreateOptions) (*specgen.Pod
s.CgroupParent = p.CgroupParent
// Resource config
cpuDat := p.CPULimits()
if s.ResourceLimits == nil {
s.ResourceLimits = &specs.LinuxResources{}
s.ResourceLimits.CPU = &specs.LinuxCPU{}
}
if cpuDat != nil {
s.ResourceLimits.CPU = cpuDat
if p.Cpus != 0 {
s.CPUPeriod = *cpuDat.Period
s.CPUQuota = *cpuDat.Quota
}
}
s.ResourceLimits.CPU = p.CPULimits()
s.Userns = p.Userns
sysctl := map[string]string{}
if ctl := p.Sysctl; len(ctl) > 0 {

View File

@ -248,12 +248,6 @@ type PodSpecGenerator struct {
type PodResourceConfig struct {
// ResourceLimits contains linux specific CPU data for the pod
ResourceLimits *spec.LinuxResources `json:"resource_limits,omitempty"`
// CPU period of the cpuset, determined by --cpus
CPUPeriod uint64 `json:"cpu_period,omitempty"`
// CPU quota of the cpuset, determined by --cpus
CPUQuota int64 `json:"cpu_quota,omitempty"`
// ThrottleReadBpsDevice contains the rate at which the devices in the pod can be read from/accessed
ThrottleReadBpsDevice map[string]spec.LinuxThrottleDevice `json:"throttleReadBpsDevice,omitempty"`
}
type PodSecurityConfig struct {