Skip to content

Commit 3f772ae

Browse files
authored
Correct the version for the backup encryption feature (#2376)
* Correct the version for the backup encryption feature
1 parent f1324b1 commit 3f772ae

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed

api/v1beta2/foundationdb_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ var Versions = struct {
165165
SupportsRecoveryState: Version{api.Version{Major: 7, Minor: 1, Patch: 22}},
166166
SupportsLocalityBasedExclusions71: Version{api.Version{Major: 7, Minor: 1, Patch: 42}},
167167
SupportsLocalityBasedExclusions: Version{api.Version{Major: 7, Minor: 3, Patch: 26}},
168-
SupportsBackupEncryption: Version{api.Version{Major: 7, Minor: 3, Patch: 0}},
168+
SupportsBackupEncryption: Version{api.Version{Major: 7, Minor: 4, Patch: 6}},
169169
}

api/v1beta2/foundationdbbackup_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ type FoundationDBBackupSpec struct {
9999
// This is the configuration of the target blobstore for this backup.
100100
BlobStoreConfiguration *BlobStoreConfiguration `json:"blobStoreConfiguration,omitempty"`
101101

102-
// The path to the encryption key used to encrypt the backup.
102+
// The path to the encryption key used to encrypt the backup. This feature is only supported in FDB versions 7.4.6
103+
// or newer. Older versions will not use this flag.
103104
// +kubebuilder:validation:MaxLength=4096
104105
EncryptionKeyPath string `json:"encryptionKeyPath,omitempty"`
105106

docs/backup_spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ FoundationDBBackupSpec describes the desired state of the backup for a cluster.
108108
| customParameters | CustomParameters defines additional parameters to pass to the backup agents. | FoundationDBCustomParameters | false |
109109
| allowTagOverride | This setting defines if a user provided image can have it's own tag rather than getting the provided version appended. You have to ensure that the specified version in the Spec is compatible with the given version in your custom image. **Deprecated: use ImageConfigs instead.** | *bool | false |
110110
| blobStoreConfiguration | This is the configuration of the target blobstore for this backup. | *[BlobStoreConfiguration](#blobstoreconfiguration) | false |
111-
| encryptionKeyPath | The path to the encryption key used to encrypt the backup. | string | false |
111+
| encryptionKeyPath | The path to the encryption key used to encrypt the backup. This feature is only supported in FDB versions 7.4.6 or newer. Older versions will not use this flag. | string | false |
112112
| mainContainer | MainContainer defines customization for the foundationdb container. Note: The enableTls setting is ignored for backup agents - use TLS environment variables instead. | ContainerOverrides | false |
113113
| sidecarContainer | SidecarContainer defines customization for the foundationdb-kubernetes-sidecar container. | ContainerOverrides | false |
114114
| imageType | ImageType defines the image type that should be used for the FoundationDBCluster deployment. When the type is set to \"unified\" the deployment will use the new fdb-kubernetes-monitor. Otherwise the main container and the sidecar container will use different images. Default: split | *ImageType | false |

e2e/fixtures/fdb_backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (fdbBackup *FdbBackup) WaitForRestorableVersion(version uint64) uint64 {
275275
g.Expect(status.LatestRestorablePoint).NotTo(gomega.BeNil())
276276

277277
return ptr.Deref(status.LatestRestorablePoint.Version, 0)
278-
}).WithTimeout(10*time.Minute).WithPolling(2*time.Second).Should(gomega.BeNumerically(">", version), "error waiting for restorable version")
278+
}).WithTimeout(10*time.Minute).WithPolling(2*time.Second).Should(gomega.BeNumerically(">=", version), "error waiting for restorable version")
279279
return restorableVersion
280280
}
281281

e2e/fixtures/fdb_operator_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ spec:
400400
- name: fdb-binaries
401401
mountPath: /var/output-files
402402
securityContext:
403-
runAsUser: 0
404-
runAsGroup: 0
403+
runAsUser: 4059
404+
runAsGroup: 4059
405405
{{ end }}
406406
containers:
407407
- command:

e2e/test_operator_backups/operator_backup_test.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ import (
3636
)
3737

3838
var (
39-
factory *fixtures.Factory
40-
fdbCluster *fixtures.FdbCluster
41-
testOptions *fixtures.FactoryOptions
39+
factory *fixtures.Factory
40+
fdbCluster *fixtures.FdbCluster
41+
testOptions *fixtures.FactoryOptions
42+
supportsEncryption fdbv1beta2.Version
4243
)
4344

4445
func init() {
@@ -62,6 +63,9 @@ var _ = BeforeSuite(func() {
6263
Skip("Skip backup tests with 7.1.63 as this version has a bug in the fdbbackup agent")
6364
}
6465

66+
supportsEncryption, err = fdbv1beta2.ParseFdbVersion("7.4.6")
67+
Expect(err).NotTo(HaveOccurred())
68+
6569
// Create a blobstore for testing backups and restore.
6670
factory.CreateBlobstoreIfAbsent(factory.SingleNamespace())
6771
})
@@ -126,9 +130,10 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
126130
// In case of the one time backup we have to first write the keys and then do the backup.
127131
keyValues = fdbCluster.GenerateRandomValues(10, prefix)
128132
fdbCluster.WriteKeyValues(keyValues)
133+
currentVersion := fdbCluster.GetClusterVersion()
129134
backup = factory.CreateBackupForCluster(fdbCluster, backupConfiguration)
130135
restorableVersion = backup.WaitForRestorableVersion(
131-
fdbCluster.GetClusterVersion(),
136+
currentVersion,
132137
)
133138
}
134139

@@ -157,22 +162,23 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
157162

158163
When("encryption is enabled", func() {
159164
BeforeEach(func() {
160-
requiredFdbVersion, err := fdbv1beta2.ParseFdbVersion("7.4.5")
161-
Expect(err).NotTo(HaveOccurred())
162-
163-
version := factory.GetFDBVersion()
164-
if !version.IsAtLeast(requiredFdbVersion) {
165+
if !factory.GetFDBVersion().IsAtLeast(supportsEncryption) {
165166
Skip(
166-
"version has a bug in the backup version that prevents tests to succeed",
167+
"version doesn't support the encryption feature",
167168
)
168169
}
169170

170171
backupConfiguration.EncryptionEnabled = true
171172
})
172173

173-
It("should restore the cluster successfully with a restorable version", func() {
174-
Expect(fdbCluster.GetRange([]byte{prefix}, 25, 60)).Should(Equal(keyValues))
175-
})
174+
It(
175+
"should restore the cluster successfully with a restorable version",
176+
func() {
177+
Expect(
178+
fdbCluster.GetRange([]byte{prefix}, 25, 60),
179+
).Should(Equal(keyValues))
180+
},
181+
)
176182
})
177183

178184
// TODO (johscheuer): Enable test once the CRD in CI is updated.
@@ -203,13 +209,9 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
203209

204210
When("encryption is enabled", func() {
205211
BeforeEach(func() {
206-
requiredFdbVersion, err := fdbv1beta2.ParseFdbVersion("7.4.5")
207-
Expect(err).NotTo(HaveOccurred())
208-
209-
version := factory.GetFDBVersion()
210-
if !version.IsAtLeast(requiredFdbVersion) {
212+
if !factory.GetFDBVersion().IsAtLeast(supportsEncryption) {
211213
Skip(
212-
"version has a bug in the backup version that prevents tests to succeed",
214+
"version doesn't support the encryption feature",
213215
)
214216
}
215217

fdbclient/admin_client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,15 +1209,15 @@ protocol fdb00b071010000`,
12091209
),
12101210
Entry(
12111211
"version that supports backup encryption without key",
1212-
"7.3.1",
1212+
fdbv1beta2.Versions.SupportsBackupEncryption.String(),
12131213
"",
12141214
nil,
12151215
false,
12161216
false,
12171217
),
12181218
Entry(
12191219
"version that supports backup encryption with key",
1220-
"7.3.1",
1220+
fdbv1beta2.Versions.SupportsBackupEncryption.String(),
12211221
"/path/to/key",
12221222
nil,
12231223
true,

0 commit comments

Comments
 (0)