From a6265ab76dbd28330e8fef91fe89f40b2e0c7585 Mon Sep 17 00:00:00 2001 From: philipyoo Date: Mon, 9 Apr 2018 14:33:26 -0700 Subject: [PATCH] ft: edit usage of uid on buckets Add uid on all buckets for future use and should be backwards compatible. --- lib/api/bucketPutLifecycle.js | 3 --- lib/metadata/ModelVersion.md | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/api/bucketPutLifecycle.js b/lib/api/bucketPutLifecycle.js index 51e2a03c33..8d235cb2b2 100644 --- a/lib/api/bucketPutLifecycle.js +++ b/lib/api/bucketPutLifecycle.js @@ -46,9 +46,6 @@ function bucketPutLifecycle(authInfo, request, log, callback) { }), (bucket, lcConfig, next) => { bucket.setLifecycleConfiguration(lcConfig); - if (!bucket.getUid()) { - bucket.generateUid(); - } metadata.updateBucket(bucket.getName(), bucket, log, err => next(err, bucket)); }, diff --git a/lib/metadata/ModelVersion.md b/lib/metadata/ModelVersion.md index 80d09f5118..fd0540310f 100644 --- a/lib/metadata/ModelVersion.md +++ b/lib/metadata/ModelVersion.md @@ -79,14 +79,15 @@ this._lifecycleConfiguration = lifecycleConfiguration || null; ### Usage -Used to store the bucket lifecycle configuration info +Used to store the bucket lifecycle configuration info. +Backwards compatible: add a uid to bucket if not exist. Otherwise, use existing ## Model version 7 ### Properties Added ```javascript -this._uid = uid || undefined; +this._uid = uid || uuid(); ``` ### Usage