From 45bacbabaa4c48d2ecb3d3c76abad130096b9863 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Mon, 24 Oct 2016 15:50:24 -0400 Subject: [PATCH 1/2] s/Regions/Deployments --- static/js/core-config-setup.js | 2 +- test/test_license.py | 99 +++++++++++++++++----------------- util/license.py | 8 ++- 3 files changed, 57 insertions(+), 52 deletions(-) diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js index 3cbafb175..04b963b6b 100644 --- a/static/js/core-config-setup.js +++ b/static/js/core-config-setup.js @@ -1274,7 +1274,7 @@ angular.module("core-config-setup", ['angularFileUpload']) $scope.requirementTitles = { 'software.quay': 'Quay Enterprise', - 'software.quay.regions': 'Distributed Storage Regions' + 'software.quay.deployments': 'Quay Enterprise Deployments' }; var handleLicenseSuccess = function(resp) { diff --git a/test/test_license.py b/test/test_license.py index c10f6a23e..0c5a72c1e 100644 --- a/test/test_license.py +++ b/test/test_license.py @@ -10,7 +10,8 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_der_public_key from util.license import (decode_license, LicenseDecodeError, ExpirationType, - MONTHLY_GRACE_PERIOD, YEARLY_GRACE_PERIOD, TRIAL_GRACE_PERIOD) + MONTHLY_GRACE_PERIOD, YEARLY_GRACE_PERIOD, TRIAL_GRACE_PERIOD, + QUAY_DEPLOYMENTS_ENTITLEMENT, QUAY_ENTITLEMENT) def get_date(delta): @@ -75,7 +76,7 @@ class TestLicense(unittest.TestCase): "expirationDate": get_date(timedelta(days=10)), }) - self.assertNotValid(license, requirement='software.quay') + self.assertNotValid(license, requirement=QUAY_ENTITLEMENT) def test_empty_subscriptions(self): license = self.create_license({ @@ -83,7 +84,7 @@ class TestLicense(unittest.TestCase): "subscriptions": {}, }) - self.assertNotValid(license, requirement='software.quay') + self.assertNotValid(license, requirement=QUAY_ENTITLEMENT) def test_missing_quay_entitlement(self): license = self.create_license({ @@ -92,13 +93,13 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay.regions": 0, + QUAY_DEPLOYMENTS_ENTITLEMENT: 0, }, }, }, }) - self.assertNotValid(license, requirement='software.quay') + self.assertNotValid(license, requirement=QUAY_ENTITLEMENT) def test_valid_quay_entitlement(self): license = self.create_license({ @@ -107,8 +108,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -122,8 +123,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -138,8 +139,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -154,8 +155,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(MONTHLY_GRACE_PERIOD * -1 + timedelta(days=1)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -171,8 +172,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(MONTHLY_GRACE_PERIOD * -1 + timedelta(days=1)), "durationPeriod": "monthly", "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -188,8 +189,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(MONTHLY_GRACE_PERIOD * -1 + timedelta(days=-1)), "durationPeriod": "monthly", "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -205,8 +206,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(YEARLY_GRACE_PERIOD * -1 + timedelta(days=1)), "durationPeriod": "yearly", "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -222,8 +223,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(YEARLY_GRACE_PERIOD * -1 + timedelta(days=-1)), "durationPeriod": "yearly", "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -239,8 +240,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=1)), "inTrial": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -256,8 +257,8 @@ class TestLicense(unittest.TestCase): "serviceEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=-1)), "inTrial": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -273,8 +274,8 @@ class TestLicense(unittest.TestCase): "trialEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=1)), "trialOnly": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -290,8 +291,8 @@ class TestLicense(unittest.TestCase): "trialEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=-1)), "trialOnly": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -306,8 +307,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -328,8 +329,8 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, }, @@ -342,7 +343,7 @@ class TestLicense(unittest.TestCase): ], } - self.assertNotValid(license, config=config, requirement='software.quay.regions') + self.assertNotValid(license, config=config, requirement=QUAY_DEPLOYMENTS_ENTITLEMENT) def test_valid_regions_across_multiple_sub(self): license = self.create_license({ @@ -351,14 +352,14 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, "anothersub": { "serviceEnd": get_date(timedelta(days=20)), "entitlements": { - "software.quay.regions": 5, + QUAY_DEPLOYMENTS_ENTITLEMENT: 5, }, }, }, @@ -382,15 +383,15 @@ class TestLicense(unittest.TestCase): "somesub": { "serviceEnd": get_date(timedelta(days=10)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 1, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 1, }, }, "anothersub": { "trialEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=-1)), "trialOnly": True, "entitlements": { - "software.quay.regions": 5, + QUAY_DEPLOYMENTS_ENTITLEMENT: 5, }, }, }, @@ -403,7 +404,7 @@ class TestLicense(unittest.TestCase): ], } - self.assertNotValid(license, config=config, requirement='software.quay.regions', + self.assertNotValid(license, config=config, requirement=QUAY_DEPLOYMENTS_ENTITLEMENT, expired=ExpirationType.trial_only) def test_valid_regions_across_multiple_sub_one_expired(self): @@ -414,15 +415,15 @@ class TestLicense(unittest.TestCase): "trialEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=-1)), "trialOnly": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 3, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 3, }, }, "anothersub": { "serviceEnd": get_date(timedelta(days=20)), "entitlements": { - "software.quay": 1, - "software.quay.regions": 5, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 5, }, }, }, @@ -445,14 +446,14 @@ class TestLicense(unittest.TestCase): "trialEnd": get_date(TRIAL_GRACE_PERIOD * -1 + timedelta(days=-1)), "trialOnly": True, "entitlements": { - "software.quay": 1, - "software.quay.regions": 3, + QUAY_ENTITLEMENT: 1, + QUAY_DEPLOYMENTS_ENTITLEMENT: 3, }, }, "anothersub": { "serviceEnd": get_date(timedelta(days=20)), "entitlements": { - "software.quay.regions": 5, + QUAY_DEPLOYMENTS_ENTITLEMENT: 5, }, }, }, @@ -466,7 +467,7 @@ class TestLicense(unittest.TestCase): } self.assertNotValid(license, config=config, expired=ExpirationType.trial_only, - requirement='software.quay') + requirement=QUAY_ENTITLEMENT) if __name__ == '__main__': unittest.main() diff --git a/util/license.py b/util/license.py index 663349a31..f9622cddd 100644 --- a/util/license.py +++ b/util/license.py @@ -26,6 +26,10 @@ MONTHLY_GRACE_PERIOD = timedelta(335, 0) # 11 months YEARLY_GRACE_PERIOD = timedelta(90, 0) # 3 months LICENSE_FILENAME = 'license' +QUAY_ENTITLEMENT = 'software.quay' +QUAY_DEPLOYMENTS_ENTITLEMENT = 'software.quay.deployments' + + class LicenseDecodeError(Exception): """ Exception raised if the license could not be read, decoded or has expired. """ @@ -314,8 +318,8 @@ EntitlementRequirement = namedtuple('EntitlementRequirements', ['name', 'count'] def _gen_entitlement_requirements(config_obj): config_regions = len(config_obj.get('DISTRIBUTED_STORAGE_CONFIG', [])) return [ - EntitlementRequirement('software.quay', 1), - EntitlementRequirement('software.quay.regions', config_regions), + EntitlementRequirement(QUAY_ENTITLEMENT, 1), + EntitlementRequirement(QUAY_DEPLOYMENTS_ENTITLEMENT, config_regions), ] From 1060e8a61426300685fe2e8531be80b0b501b6cf Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Mon, 24 Oct 2016 14:05:22 -0400 Subject: [PATCH 2/2] Prepare the changelog for v2.0.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41cd5317d..921d26300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +### v2.0.0 + +This release is a **required release** and must be run before attempting an upgrade to v2.0.0+. + +In order to upgrade to this version, your cluster must contain a valid license, which can be found and downloaded at: [tectonic.com](https://account.tectonic.com) + +- Added: Require valid license to enable registry actions (#2009, #2018) +- Added: The ability to delete users and organizations (#1698) +- Added: Add option to properly handle TLS terminated outside of the container (#1986) +- Added: Updated run trigger/build dialog (#1895) +- Added: Update dependencies to latest versions (#2012) +- Added: Ability to use dots and dashes in namespaces intended for use with newer Docker clients (#1852) +- Added: Changed dead queue item cleanup from 7 days to 1 day (#2019) +- Added: Add a default database timeout to prevent failed DB connections from hanging registry and API operations (#1764) + +- Fixed: Fix error if a vulnerability notification doesn't have a level filter (#1995) +- Fixed: Registry WWW-Authenticate and Link headers are now Registry API compliant (#2004) +- Fixed: Small fixes for Message of the Day feature (#2005, #2006) +- Fixed: Disallow underscores at the beginning of namespaces (#1852) +- Fixed: Installation tool liveness checks during container restarts (#2023) + ### v1.18.0 - Added: Add message of the day (#1953)