Skip to content

Commit 4b9b151

Browse files
Use capacity buffer namespace for injected fake pods
1 parent 44058d2 commit 4b9b151

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cluster-autoscaler/processors/capacitybuffer/pod_list_processor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (p *CapacityBufferPodListProcessor) updateBufferStatus(buffer *v1alpha1.Cap
163163
// makeFakePods creates podCount number of copies of the sample pod
164164
func makeFakePods(buffer *v1alpha1.CapacityBuffer, samplePodTemplate *apiv1.PodTemplateSpec, podCount int) ([]*apiv1.Pod, error) {
165165
var fakePods []*apiv1.Pod
166-
samplePod := getPodFromTemplate(samplePodTemplate)
166+
samplePod := getPodFromTemplate(samplePodTemplate, buffer.Namespace)
167167
for i := 1; i <= podCount; i++ {
168168
fakePod := samplePod.DeepCopy()
169169
fakePod = withCapacityBufferFakePodAnnotation(fakePod)
@@ -190,15 +190,15 @@ func isFakeCapacityBuffersPod(pod *apiv1.Pod) bool {
190190
return pod.Annotations[CapacityBufferFakePodAnnotationKey] == CapacityBufferFakePodAnnotationValue
191191
}
192192

193-
func getPodFromTemplate(template *apiv1.PodTemplateSpec) *apiv1.Pod {
193+
func getPodFromTemplate(template *apiv1.PodTemplateSpec, namespace string) *apiv1.Pod {
194194
desiredLabels := getPodsLabelSet(template)
195195
desiredFinalizers := getPodsFinalizers(template)
196196
desiredAnnotations := getPodsAnnotationSet(template)
197197

198198
pod := &apiv1.Pod{
199199
ObjectMeta: metav1.ObjectMeta{
200200
Labels: desiredLabels,
201-
Namespace: template.Namespace,
201+
Namespace: namespace,
202202
Annotations: desiredAnnotations,
203203
GenerateName: uuid.NewString(),
204204
Finalizers: desiredFinalizers,

0 commit comments

Comments
 (0)