Skip to content

Commit 503bdff

Browse files
authored
Merge pull request #8830 from abdelrahman882/fake-pods-namespace
Use capacity buffer namespace for injected fake pods
2 parents f5c2125 + 4b9b151 commit 503bdff

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
@@ -170,7 +170,7 @@ func (p *CapacityBufferPodListProcessor) updateBufferStatus(buffer *v1alpha1.Cap
170170
// makeFakePods creates podCount number of copies of the sample pod
171171
func makeFakePods(buffer *v1alpha1.CapacityBuffer, samplePodTemplate *apiv1.PodTemplateSpec, podCount int) ([]*apiv1.Pod, error) {
172172
var fakePods []*apiv1.Pod
173-
samplePod := getPodFromTemplate(samplePodTemplate)
173+
samplePod := getPodFromTemplate(samplePodTemplate, buffer.Namespace)
174174
for i := 1; i <= podCount; i++ {
175175
fakePod := samplePod.DeepCopy()
176176
fakePod = withCapacityBufferFakePodAnnotation(fakePod)
@@ -197,15 +197,15 @@ func isFakeCapacityBuffersPod(pod *apiv1.Pod) bool {
197197
return pod.Annotations[CapacityBufferFakePodAnnotationKey] == CapacityBufferFakePodAnnotationValue
198198
}
199199

200-
func getPodFromTemplate(template *apiv1.PodTemplateSpec) *apiv1.Pod {
200+
func getPodFromTemplate(template *apiv1.PodTemplateSpec, namespace string) *apiv1.Pod {
201201
desiredLabels := getPodsLabelSet(template)
202202
desiredFinalizers := getPodsFinalizers(template)
203203
desiredAnnotations := getPodsAnnotationSet(template)
204204

205205
pod := &apiv1.Pod{
206206
ObjectMeta: metav1.ObjectMeta{
207207
Labels: desiredLabels,
208-
Namespace: template.Namespace,
208+
Namespace: namespace,
209209
Annotations: desiredAnnotations,
210210
GenerateName: uuid.NewString(),
211211
Finalizers: desiredFinalizers,

0 commit comments

Comments
 (0)