Skip to content

Commit

Permalink
fix panic when CPU burst is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Aug 5, 2024
1 parent bf57a8a commit ee6d6c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tsuru/client/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ func renderPlans(plans []apptypes.Plan, opts renderPlansOpts) string {
}

if showBurstColumn {
cpuBurst := p.CPUBurst.Default
var cpuBurst float64 = 1

if p.CPUBurst != nil {
cpuBurst = p.CPUBurst.Default
}

cpuBurstObservation := ""
if p.Override != nil && p.Override.CPUBurst != nil {
cpuBurst = *p.Override.CPUBurst
Expand Down Expand Up @@ -217,7 +222,7 @@ func renderPlansK8SFriendly(plans []apptypes.Plan, showMaxBurstAllowed bool) str
}

if showCPULimitsColumn {
cpuBurst := p.CPUBurst.Default
cpuBurst := p.GetCPUBurst()
if cpuBurst < 1 {
cpuBurst = 1
}
Expand Down

0 comments on commit ee6d6c6

Please sign in to comment.