public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 widget-toolkit] apt repositories: add production ready warnings for Ceph repositories
@ 2023-06-16 13:42 Fiona Ebner
  2023-06-16 13:50 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2023-06-16 13:42 UTC (permalink / raw)
  To: pve-devel

Could've been done for the test repository already, but now that there
is a split between no-subscription and enterprise it becomes even more
relevant.

Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Changes in v2:
    * rebase on current master.

 src/node/APTRepositories.js | 48 ++++++++++++++++++++++++++++++-------
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 016118e..53af2c7 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -460,6 +460,11 @@ Ext.define('Proxmox.node.APTRepositories', {
 	    let enterprise = vm.get('enterpriseRepo');
 	    let nosubscription = vm.get('noSubscriptionRepo');
 	    let test = vm.get('testRepo');
+	    let cephRepos = {
+		enterprise: vm.get('cephEnterpriseRepo'),
+		nosubscription: vm.get('cephNoSubscriptionRepo'),
+		test: vm.get('cephTestRepo'),
+	    };
 	    let wrongSuites = vm.get('suitesWarning');
 	    let mixedSuites = vm.get('mixedSuites');
 
@@ -483,17 +488,33 @@ Ext.define('Proxmox.node.APTRepositories', {
 		addWarn(gettext('Detected mixed suites before upgrade'));
 	    }
 
-	    if (!activeSubscription && enterprise) {
-		addWarn(gettext('The enterprise repository is enabled, but there is no active subscription!'));
-	    }
+	    let productionReadyCheck = (repos, type, noSubAlternateName) => {
+		if (!activeSubscription && repos.enterprise) {
+		    addWarn(Ext.String.format(
+			gettext('The {0}enterprise repository is enabled, but there is no active subscription!'),
+			type,
+		    ));
+		}
 
-	    if (nosubscription) {
-		addWarn(gettext('The no-subscription repository is not recommended for production use!'));
-	    }
+		if (repos.nosubscription) {
+		    addWarn(Ext.String.format(
+			gettext('The {0}no-subscription{1} repository is not recommended for production use!'),
+			type,
+			noSubAlternateName,
+		    ));
+		}
 
-	    if (test) {
-		addWarn(gettext('The test repository may pull in unstable updates and is not recommended for production use!'));
-	    }
+		if (repos.test) {
+		    addWarn(Ext.String.format(
+			gettext('The {0}test repository may pull in unstable updates and is not recommended for production use!'),
+			type,
+		    ));
+		}
+	    };
+
+	    productionReadyCheck({ enterprise, nosubscription, test }, '', '');
+	    // TODO drop alternate 'main' name when no longer relevant
+	    productionReadyCheck(cephRepos, 'Ceph ', '/main');
 
 	    if (errors.length > 0) {
 		text = gettext('Fatal parsing error for at least one repository');
@@ -518,6 +539,9 @@ Ext.define('Proxmox.node.APTRepositories', {
 	    noSubscriptionRepo: '',
 	    enterpriseRepo: '',
 	    testRepo: '',
+	    cephEnterpriseRepo: '',
+	    cephNoSubscriptionRepo: '',
+	    cephTestRepo: '',
 	    selectionenabled: false,
 	    state: {},
 	},
@@ -627,6 +651,12 @@ Ext.define('Proxmox.node.APTRepositories', {
 		vm.set('noSubscriptionRepo', status);
 	    } else if (handle === 'test') {
 		vm.set('testRepo', status);
+	    } else if (handle.match(/^ceph-[a-zA-Z]+-enterprise$/)) {
+		vm.set('cephEnterpriseRepo', status);
+	    } else if (handle.match(/^ceph-[a-zA-Z]+-no-subscription$/)) {
+		vm.set('cephNoSubscriptionRepo', status);
+	    } else if (handle.match(/^ceph-[a-zA-Z]+-test$/)) {
+		vm.set('cephTestRepo', status);
 	    }
 	    me.getController().updateState();
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH v2 widget-toolkit] apt repositories: add production ready warnings for Ceph repositories
  2023-06-16 13:42 [pve-devel] [PATCH v2 widget-toolkit] apt repositories: add production ready warnings for Ceph repositories Fiona Ebner
@ 2023-06-16 13:50 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-16 13:50 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 16/06/2023 um 15:42 schrieb Fiona Ebner:
> Could've been done for the test repository already, but now that there
> is a split between no-subscription and enterprise it becomes even more
> relevant.
> 
> Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> 
> Changes in v2:
>     * rebase on current master.
> 
>  src/node/APTRepositories.js | 48 ++++++++++++++++++++++++++++++-------
>  1 file changed, 39 insertions(+), 9 deletions(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-16 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 13:42 [pve-devel] [PATCH v2 widget-toolkit] apt repositories: add production ready warnings for Ceph repositories Fiona Ebner
2023-06-16 13:50 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal