Skip to content

Commit

Permalink
Extended job aux resource (#1262)
Browse files Browse the repository at this point in the history
* Extended job aux resource

* Extended job aux resource
  • Loading branch information
satr authored Jan 3, 2025
1 parent 20d238b commit 97d9640
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/radix-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: radix-operator
version: 1.48.2
appVersion: 1.68.2
version: 1.48.3
appVersion: 1.68.3
kubeVersion: ">=1.24.0"
description: Radix Operator
keywords:
Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/equinor/radix-operator/pkg/apis/utils/resources"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -639,7 +640,9 @@ func (deploy *Deployment) getCurrentAndDesiredJobAuxDeployment(ctx context.Conte
}
return nil, nil, err
}
return currentJobAuxDeployment, currentJobAuxDeployment.DeepCopy(), nil
desiredJobAuxDeployment := currentJobAuxDeployment.DeepCopy()
desiredJobAuxDeployment.Spec.Template.Spec.Containers[0].Resources = resources.New(resources.WithCPUMilli(1), resources.WithMemoryMega(20))
return currentJobAuxDeployment, desiredJobAuxDeployment, nil
}

func getJobAuxObjectName(jobName string) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/deployment/kubedeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (deploy *Deployment) createJobAuxDeployment(deployComponent v1.RadixCommonD
Spec: corev1.PodSpec{Containers: []corev1.Container{
{
Name: jobAuxDeploymentName,
Resources: resources.New(resources.WithCPUMilli(1), resources.WithMemoryMega(10)),
Resources: resources.New(resources.WithCPUMilli(1), resources.WithMemoryMega(20)),
}},
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/deployment/kubedeployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestDeployment_createJobAuxDeployment(t *testing.T) {
resources := jobAuxDeployment.Spec.Template.Spec.Containers[0].Resources
s := resources.Requests.Cpu().String()
assert.Equal(t, "1m", s)
assert.Equal(t, "10M", resources.Requests.Memory().String())
assert.Equal(t, "20M", resources.Requests.Memory().String())
assert.Equal(t, "0", resources.Limits.Cpu().String())
assert.Equal(t, "10M", resources.Limits.Memory().String())
assert.Equal(t, "20M", resources.Limits.Memory().String())
}

0 comments on commit 97d9640

Please sign in to comment.