Compression of SGBackup is being lost after operator upgrade
Summary
Given a SGBackup made with the operator 0.9.5, the compression information stored in .status.sgBackupConfig.compression, its being lost after upgrading the operator to 1.0.0.
Current Behaviour
The SGBackup Schema specifies the .status.sgBackupConfig as the following:
sgBackupConfig:
type: object
description: The name of the backup configuration used to perform this backup.
properties:
compression:
type: string
description: |
Select the backup compression algorithm. Possible options are: lz4, lzma, brotli. The default method is `lz4`. LZ4 is the fastest method, but compression ratio is the worst. LZMA is way slower, but it compresses backups about 6 times better than LZ4. Brotli is a good trade-off between speed and compression ratio, being about 3 times better than LZ4.
enum: [lz4, lzma, brotli]
Nonetheless, in 0.9.5 the operator .status.sgBackupConfig store this information in the following manner:
"sgBackupConfig": {
"baseBackups": {
"compression": "lz4"
}
Which doesn't comply with the CRD Schema.
Since in StackGres 1.0.0 Conversion Webhooks were introduced, unknown fields are not preserved. Hence, the loss of information after the CRD upgrade.
Steps to reproduce
- Create a SGCluster with the 0.9.5 operator, which a backup configuration.
- Perform a SGBackup
- Upgrade the operator to 1.0.0-beta2.
Expected Behaviour
No information should be loss during the CRD upgrade.
Environment
-
StackGres version: 1.0.0-beta2
-
Kubernetes version: 1.16
-
Cloud provider or hardware configuration: kind