Created
December 24, 2018 10:04
-
-
Save lordofthejars/a9fc20a5190304b0c1a67da8f14bb540 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func newPodForCR(cr *hellov1alpha1.Hello) *corev1.Pod { | |
msg := cr.Spec.Message | |
labels := map[string]string{ | |
"app": cr.Name, | |
} | |
return &corev1.Pod{ | |
ObjectMeta: metav1.ObjectMeta{ | |
Name: cr.Name + "-pod", | |
Namespace: cr.Namespace, | |
Labels: labels, | |
}, | |
Spec: corev1.PodSpec{ | |
Containers: []corev1.Container{ | |
{ | |
Name: "whalesay", | |
Image: "docker/whalesay", | |
Command: []string{"cowsay", msg}, | |
}, | |
}, | |
RestartPolicy: "Never", | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment