Skip to content

Commit 663a2ae

Browse files
committed
remove from status the info that is updated every freaking time
1 parent 0d0351e commit 663a2ae

File tree

9 files changed

+12
-55
lines changed

9 files changed

+12
-55
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25584,16 +25584,11 @@ spec:
2558425584
properties:
2558525585
currentSize:
2558625586
type: string
25587-
lastCheckTime:
25588-
format: date-time
25589-
type: string
2559025587
lastError:
2559125588
type: string
2559225589
lastResizeTime:
2559325590
format: date-time
2559425591
type: string
25595-
lastUsagePercent:
25596-
type: integer
2559725592
resizeCount:
2559825593
format: int32
2559925594
type: integer

deploy/bundle.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26445,16 +26445,11 @@ spec:
2644526445
properties:
2644626446
currentSize:
2644726447
type: string
26448-
lastCheckTime:
26449-
format: date-time
26450-
type: string
2645126448
lastError:
2645226449
type: string
2645326450
lastResizeTime:
2645426451
format: date-time
2645526452
type: string
26456-
lastUsagePercent:
26457-
type: integer
2645826453
resizeCount:
2645926454
format: int32
2646026455
type: integer

deploy/cr.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ spec:
1212
# clusterServiceDNSMode: "Internal"
1313
# pause: true
1414
# unmanaged: false
15-
# enableVolumeExpansion: false
15+
enableVolumeExpansion: true
16+
storageAutoscaling:
17+
enabled: true
18+
triggerThresholdPercent: 80
19+
growthStepGi: 2
20+
maxSize: "10Gi"
1621
# enableExternalVolumeAutoscaling: false
1722
crVersion: 1.22.0
1823
image: perconalab/percona-server-mongodb-operator:main-mongod8.0

deploy/crd.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26445,16 +26445,11 @@ spec:
2644526445
properties:
2644626446
currentSize:
2644726447
type: string
26448-
lastCheckTime:
26449-
format: date-time
26450-
type: string
2645126448
lastError:
2645226449
type: string
2645326450
lastResizeTime:
2645426451
format: date-time
2645526452
type: string
26456-
lastUsagePercent:
26457-
type: integer
2645826453
resizeCount:
2645926454
format: int32
2646026455
type: integer

deploy/cw-bundle.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26445,16 +26445,11 @@ spec:
2644526445
properties:
2644626446
currentSize:
2644726447
type: string
26448-
lastCheckTime:
26449-
format: date-time
26450-
type: string
2645126448
lastError:
2645226449
type: string
2645326450
lastResizeTime:
2645426451
format: date-time
2645526452
type: string
26456-
lastUsagePercent:
26457-
type: integer
2645826453
resizeCount:
2645926454
format: int32
2646026455
type: integer

e2e-tests/version-service/conf/crd.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26445,16 +26445,11 @@ spec:
2644526445
properties:
2644626446
currentSize:
2644726447
type: string
26448-
lastCheckTime:
26449-
format: date-time
26450-
type: string
2645126448
lastError:
2645226449
type: string
2645326450
lastResizeTime:
2645426451
format: date-time
2645526452
type: string
26456-
lastUsagePercent:
26457-
type: integer
2645826453
resizeCount:
2645926454
format: int32
2646026455
type: integer

pkg/apis/psmdb/v1/psmdb_types.go

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -949,23 +949,10 @@ type StorageAutoscalingSpec struct {
949949

950950
// StorageAutoscalingStatus tracks the autoscaling state for a specific PVC
951951
type StorageAutoscalingStatus struct {
952-
// CurrentSize is the current size of the PVC
953-
CurrentSize string `json:"currentSize,omitempty"`
954-
955-
// LastResizeTime is the timestamp of the last resize operation
956-
LastResizeTime *metav1.Time `json:"lastResizeTime,omitempty"`
957-
958-
// ResizeCount is the number of times the PVC has been resized
959-
ResizeCount int32 `json:"resizeCount,omitempty"`
960-
961-
// LastCheckTime is the timestamp of the last storage check
962-
LastCheckTime *metav1.Time `json:"lastCheckTime,omitempty"`
963-
964-
// LastUsagePercent is the last recorded disk usage percentage
965-
LastUsagePercent int `json:"lastUsagePercent,omitempty"`
966-
967-
// LastError contains the error message from the last failed resize attempt
968-
LastError string `json:"lastError,omitempty"`
952+
CurrentSize string `json:"currentSize,omitempty"`
953+
LastResizeTime metav1.Time `json:"lastResizeTime,omitempty"`
954+
ResizeCount int32 `json:"resizeCount,omitempty"`
955+
LastError string `json:"lastError,omitempty"`
969956
}
970957

971958
type SecretsSpec struct {

pkg/apis/psmdb/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controller/perconaservermongodb/volume_autoscaling.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func (r *ReconcilePerconaServerMongoDB) triggerResize(
209209
}
210210

211211
status := cr.Status.StorageAutoscaling[pvc.Name]
212-
status.LastResizeTime = &metav1.Time{Time: time.Now()}
212+
status.LastResizeTime = metav1.Time{Time: time.Now()}
213213
status.ResizeCount++
214214
cr.Status.StorageAutoscaling[pvc.Name] = status
215215

@@ -232,12 +232,9 @@ func (r *ReconcilePerconaServerMongoDB) updateAutoscalingStatus(
232232
}
233233

234234
status := cr.Status.StorageAutoscaling[pvcName]
235-
now := metav1.Time{Time: time.Now()}
236-
status.LastCheckTime = &now
237235

238236
if usage != nil {
239237
status.CurrentSize = resource.NewQuantity(usage.TotalBytes, resource.BinarySI).String()
240-
status.LastUsagePercent = usage.UsagePercent
241238
status.LastError = ""
242239
}
243240

0 commit comments

Comments
 (0)