Slide 69
Slide 69 text
#devconf_cz @jewzaam / @thedoh
Customize the Controller
69
func newPodForCR(cr *podv1alpha1.PodRequest) *corev1.Pod {
labels := map[string]string{
"app": cr.Name,
}
return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: cr.Name,
Namespace: cr.Namespace,
Labels: labels,
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: cr.Spec.Name,
Image: cr.Spec.Image,
Command: cr.Spec.Command,
},
},
},
}
}