File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 GenerateFunc : wrapVPAFunc (func (a * autoscaling.VerticalPodAutoscaler ) * metric.Family {
6161 ms := []* metric.Metric {}
6262
63- if a .Spec .UpdatePolicy .UpdateMode == nil {
63+ if a .Spec .UpdatePolicy == nil || a . Spec . UpdatePolicy .UpdateMode == nil {
6464 return & metric.Family {
6565 Metrics : ms ,
6666 }
9696 Help : "Minimum resources the VerticalPodAutoscaler can set for containers matching the name." ,
9797 GenerateFunc : wrapVPAFunc (func (a * autoscaling.VerticalPodAutoscaler ) * metric.Family {
9898 ms := []* metric.Metric {}
99+ if a .Spec .ResourcePolicy == nil || a .Spec .ResourcePolicy .ContainerPolicies == nil {
100+ return & metric.Family {
101+ Metrics : ms ,
102+ }
103+ }
104+
99105 for _ , c := range a .Spec .ResourcePolicy .ContainerPolicies {
100106 ms = append (ms , vpaResourcesToMetrics (c .ContainerName , c .MinAllowed )... )
101107
@@ -111,6 +117,12 @@ var (
111117 Help : "Maximum resources the VerticalPodAutoscaler can set for containers matching the name." ,
112118 GenerateFunc : wrapVPAFunc (func (a * autoscaling.VerticalPodAutoscaler ) * metric.Family {
113119 ms := []* metric.Metric {}
120+ if a .Spec .ResourcePolicy == nil || a .Spec .ResourcePolicy .ContainerPolicies == nil {
121+ return & metric.Family {
122+ Metrics : ms ,
123+ }
124+ }
125+
114126 for _ , c := range a .Spec .ResourcePolicy .ContainerPolicies {
115127 ms = append (ms , vpaResourcesToMetrics (c .ContainerName , c .MaxAllowed )... )
116128 }
You can’t perform that action at this time.
0 commit comments