Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (p *CapacityBufferPodListProcessor) updateBufferStatus(buffer *v1alpha1.Cap
// makeFakePods creates podCount number of copies of the sample pod
func makeFakePods(buffer *v1alpha1.CapacityBuffer, samplePodTemplate *apiv1.PodTemplateSpec, podCount int) ([]*apiv1.Pod, error) {
var fakePods []*apiv1.Pod
samplePod := getPodFromTemplate(samplePodTemplate)
samplePod := getPodFromTemplate(samplePodTemplate, buffer.Namespace)
for i := 1; i <= podCount; i++ {
fakePod := samplePod.DeepCopy()
fakePod = withCapacityBufferFakePodAnnotation(fakePod)
Expand All @@ -190,15 +190,15 @@ func isFakeCapacityBuffersPod(pod *apiv1.Pod) bool {
return pod.Annotations[CapacityBufferFakePodAnnotationKey] == CapacityBufferFakePodAnnotationValue
}

func getPodFromTemplate(template *apiv1.PodTemplateSpec) *apiv1.Pod {
func getPodFromTemplate(template *apiv1.PodTemplateSpec, namespace string) *apiv1.Pod {
desiredLabels := getPodsLabelSet(template)
desiredFinalizers := getPodsFinalizers(template)
desiredAnnotations := getPodsAnnotationSet(template)

pod := &apiv1.Pod{
ObjectMeta: metav1.ObjectMeta{
Labels: desiredLabels,
Namespace: template.Namespace,
Namespace: namespace,
Annotations: desiredAnnotations,
GenerateName: uuid.NewString(),
Finalizers: desiredFinalizers,
Expand Down