Update adding resourses
package pxc
import (
+ "fmt"
"strings"
appsv1 "k8s.io/api/apps/v1"
@@ -55,7 +56,13 @@ func StatefulSet(sfs api.StatefulApp, podSpec *api.PodSpec, cr *api.PerconaXtraD
pod.Containers = append(pod.Containers, sfs.SidecarContainers(podSpec, cr.Spec.SecretsName)...)
if cr.Spec.PMM != nil && cr.Spec.PMM.Enabled {
- pod.Containers = append(pod.Containers, sfs.PMMContainer(cr.Spec.PMM, cr.Spec.SecretsName, !cr.VersionLessThan120()))
+ pmmC := sfs.PMMContainer(cr.Spec.PMM, cr.Spec.SecretsName, !cr.VersionLessThan120())
+ res, err := sfs.Resources(cr.Spec.PMM.Resources)
+ if err != nil {
+ return nil, fmt.Errorf("pmm container error: create resources error: %v", err)
+ }
+ pmmC.Resources = res
+ pod.Containers = append(pod.Containers, pmmC)
}
ls := sfs.Labels()
