Commit 4e908465 authored by Brian Downs's avatar Brian Downs

add node name to s3 structure data

parent a831b8e6
...@@ -886,6 +886,8 @@ type snapshotFile struct { ...@@ -886,6 +886,8 @@ type snapshotFile struct {
// snapshots on disk or in S3 along with their relevant // snapshots on disk or in S3 along with their relevant
// metadata. // metadata.
func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapshotFile, error) { func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapshotFile, error) {
nodeName := os.Getenv("NODE_NAME")
var snapshots []snapshotFile var snapshots []snapshotFile
if e.config.EtcdS3 { if e.config.EtcdS3 {
...@@ -907,6 +909,7 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapsho ...@@ -907,6 +909,7 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapsho
snapshots = append(snapshots, snapshotFile{ snapshots = append(snapshots, snapshotFile{
Name: obj.Key, Name: obj.Key,
Location: "s3://" + filepath.Join(e.config.EtcdS3BucketName, obj.Key), Location: "s3://" + filepath.Join(e.config.EtcdS3BucketName, obj.Key),
NodeName: nodeName,
CreatedAt: &metav1.Time{ CreatedAt: &metav1.Time{
Time: ca, Time: ca,
}, },
...@@ -922,8 +925,6 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapsho ...@@ -922,8 +925,6 @@ func (e *ETCD) listSnapshots(ctx context.Context, snapshotDir string) ([]snapsho
return nil, err return nil, err
} }
nodeName := os.Getenv("NODE_NAME")
for _, f := range files { for _, f := range files {
snapshots = append(snapshots, snapshotFile{ snapshots = append(snapshots, snapshotFile{
Name: f.Name(), Name: f.Name(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment