Skip to content

Commit

Permalink
Switch to managing ETCDSnapshotFile resources
Browse files Browse the repository at this point in the history
Reconcile snapshot CRs instead of ConfigMap; manage ConfigMap downstream from CR list

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Oct 7, 2023
1 parent e50fd97 commit 84eddb1
Show file tree
Hide file tree
Showing 4 changed files with 614 additions and 214 deletions.
1 change: 1 addition & 0 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ func (e *ETCD) Register(handler http.Handler) (http.Handler, error) {
e.config.Runtime.LeaderElectedClusterControllerStarts[version.Program+"-etcd"] = func(ctx context.Context) {
registerEndpointsHandlers(ctx, e)
registerMemberHandlers(ctx, e)
registerSnapshotHandlers(ctx, e)
}
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/etcd/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (s *S3) upload(ctx context.Context, snapshot string, extraMetadata *v1.Conf
},
Compressed: strings.HasSuffix(snapshot, compressedExtension),
metadataSource: extraMetadata,
nodeSource: s.nodeName,
}

uploadInfo, err := s.uploadSnapshot(ctx, snapshotKey, snapshot)
Expand Down Expand Up @@ -394,6 +395,7 @@ func (s *S3) listSnapshots(ctx context.Context) (map[string]snapshotFile, error)
},
Status: successfulSnapshotStatus,
Compressed: compressed,
nodeSource: obj.UserMetadata[nodeNameKey],
}
sfKey := generateSnapshotName(sf)
snapshots[sfKey] = sf
Expand Down
Loading

0 comments on commit 84eddb1

Please sign in to comment.