Skip to content

Commit 6fd8a36

Browse files
authored
Merge pull request #1720 from jackyalbo/jacky-operator-fix
Avoid updating cpu and memory in pvc template
2 parents 22f1cc3 + 8de3e9e commit 6fd8a36

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

pkg/backingstore/backingstore.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ const (
247247
// Dev ENV minimal resources
248248
devEnvMinCPUString string = "500m"
249249
devEnvMinMemoryString string = "500Mi"
250+
251+
// Default volume size for pv-pool backing store
252+
defaultVolumeSize = int64(20 * 1024 * 1024 * 1024) // 20Gi=20*1024^3
250253
)
251254

252255
// CmdCreatePVPool returns a CLI command

pkg/backingstore/reconciler.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ func (r *Reconciler) ReadSystemInfo() error {
567567
))
568568
}
569569

570-
const defaultVolumeSize = int64(20 * 1024 * 1024 * 1024) // 20Gi=20*1024^3
571570
var volumeSize int64
572571
pvPool := r.BackingStore.Spec.PVPool
573572
if pvPool.VolumeResources != nil {
@@ -1393,7 +1392,14 @@ func (r *Reconciler) updatePvcTemplate() {
13931392
} else if r.NooBaa.Spec.PVPoolDefaultStorageClass != nil {
13941393
r.PvcAgentTemplate.Spec.StorageClassName = r.NooBaa.Spec.PVPoolDefaultStorageClass
13951394
}
1396-
r.PvcAgentTemplate.Spec.Resources = *r.BackingStore.Spec.PVPool.VolumeResources
1395+
var volumeSize resource.Quantity
1396+
pvPool := r.BackingStore.Spec.PVPool
1397+
if pvPool.VolumeResources != nil {
1398+
volumeSize = pvPool.VolumeResources.Requests[corev1.ResourceStorage]
1399+
} else {
1400+
volumeSize = *resource.NewQuantity(defaultVolumeSize, resource.BinarySI)
1401+
}
1402+
r.PvcAgentTemplate.Spec.Resources.Requests[corev1.ResourceStorage] = volumeSize
13971403
r.PvcAgentTemplate.Labels = map[string]string{
13981404
"app": "noobaa",
13991405
"pool": r.BackingStore.Name,

scripts/run-golangci-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ MODE="${1}"
2727
# Function to install golangci-lint (for makefile mode)
2828
install_golangci_lint() {
2929
echo "Installing the latest golangci-lint with local toolchain"
30-
if ! go install -a "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest"
30+
if ! go install -a "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0"
3131
then
3232
echo "⚠️ Failed to install golangci-lint"
3333
exit 0

0 commit comments

Comments
 (0)