Derek Nola
a81bc3325b
Transition from deprecated pointer library to ptr ( #9801 ) ( #9825 )
...
Signed-off-by: Derek Nola <derek.nola@suse.com >
2024-03-30 21:30:05 -07:00
Brad Davidson
87eae0a664
Clean up snapshotDir create/exists logic
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 3576ed4327 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-03-07 16:37:15 -08:00
Brad Davidson
10dfb09383
Add check for etcd-snapshot-dir and fix panic in Walk
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 6ec1926f88 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2024-02-10 00:49:41 -08:00
Brad Davidson
0624d2a51f
Don't apply s3 retention if S3 client failed to initialize
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-11-21 14:49:38 -08:00
Brad Davidson
52c7d6c91d
Add server token hash to CR and S3
...
This required pulling the token hash stuff out of the cluster package, into util.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit d885162967 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
e7014cf859
Switch to managing ETCDSnapshotFile resources
...
Reconcile snapshot CRs instead of ConfigMap; manage ConfigMap downstream from CR list
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 550ab36ab7 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
22c0916abd
Move snapshot delete into local/s3 functions
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 5cd4f69bfa )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
df0fd0de49
Store extra metadata and cluster ID for snapshots
...
Write the extra metadata both locally and to S3. These files are placed such that they will not be used by older versions of K3s that do not make use of them.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 7464007037 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
7375740ed4
Move s3 snapshot list functionality to s3.go
...
Also, don't list ONLY s3 snapshots if S3 is enabled.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 80f909d0ca )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
487b3948a3
Consistently set snapshotFile timestamp
...
Attempt to use timestamp from creation or filename instead of file/object modification times
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 8d47645312 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
d270e97825
Tidy s3 upload functions
...
Consistently refer to object keys as such, simplify error handling.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit f1afe153a3 )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
7a0eecd601
Elide old snapshot data when apiserver rejects configmap with ErrRequestEntityTooLarge
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 2b0e2e8ada )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00
Brad Davidson
eed767ea74
Move etcd snapshot code into separate file
...
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
(cherry picked from commit 676b00aa0e )
Signed-off-by: Brad Davidson <brad.davidson@rancher.com >
2023-10-13 11:09:28 -07:00