From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C20689D94E for ; Mon, 5 Jun 2023 16:03:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A3DC3286FE for ; Mon, 5 Jun 2023 16:02:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 5 Jun 2023 16:02:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5BB42489D7 for ; Mon, 5 Jun 2023 16:02:49 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 5 Jun 2023 16:02:42 +0200 Message-Id: <20230605140242.153466-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.048 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH widget-toolkit] apt repositories: add production ready warnings for Ceph repositories X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jun 2023 14:03:20 -0000 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 Signed-off-by: Fiona Ebner --- 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 1fb627c..edece65 100644 --- a/src/node/APTRepositories.js +++ b/src/node/APTRepositories.js @@ -449,6 +449,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'); if (!enterprise && !nosubscription && !test) { @@ -467,17 +472,33 @@ Ext.define('Proxmox.node.APTRepositories', { addWarn(gettext('Some suites are misconfigured')); } - 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'); @@ -501,6 +522,9 @@ Ext.define('Proxmox.node.APTRepositories', { noSubscriptionRepo: '', enterpriseRepo: '', testRepo: '', + cephEnterpriseRepo: '', + cephNoSubscriptionRepo: '', + cephTestRepo: '', selectionenabled: false, state: {}, }, @@ -610,6 +634,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