From cfb3392e2e56e3856f0ec6f2adea08fa7ea1c55c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:12:35 +0800 Subject: [PATCH] feat: add Insecure Skip TLS Verify checkbox in cluster-registration-url setting (backport #716) (#838) * feat: add Insecure Skip TLS Verify checkbox in cluster-registration-url setting (#716) * feat: add Insecure Skip TLS Verify checkbox Signed-off-by: Andy Lee * refactor: set insecureSkipTLSVerify default to false Signed-off-by: Andy Lee * fix: conflict Signed-off-by: Andy Lee * refactor: remove unneeded change Signed-off-by: Andy Lee * fix: get the feature flag in data() Signed-off-by: Andy Lee * refactor: make data logic simpler Signed-off-by: Andy Lee * refactor: put tip in info banner Signed-off-by: Andy Lee --------- Signed-off-by: Andy Lee (cherry picked from commit 62b80b3cec62c608d51b98e7a91a0146a91e9791) # Conflicts: # pkg/harvester/config/feature-flags.js * chore: resolve backport merge conflict Signed-off-by: Ivan Sim --------- Signed-off-by: Ivan Sim Co-authored-by: Andy Lee Co-authored-by: Ivan Sim --- .../settings/cluster-registration-url.vue | 123 ++++++++++++++++++ pkg/harvester/config/feature-flags.js | 3 + pkg/harvester/config/settings.ts | 3 +- pkg/harvester/l10n/en-us.yaml | 6 + .../models/harvesterhci.io.setting.js | 8 ++ 5 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 pkg/harvester/components/settings/cluster-registration-url.vue diff --git a/pkg/harvester/components/settings/cluster-registration-url.vue b/pkg/harvester/components/settings/cluster-registration-url.vue new file mode 100644 index 00000000..7c0d81a4 --- /dev/null +++ b/pkg/harvester/components/settings/cluster-registration-url.vue @@ -0,0 +1,123 @@ + + + diff --git a/pkg/harvester/config/feature-flags.js b/pkg/harvester/config/feature-flags.js index b3d8b827..289b1093 100644 --- a/pkg/harvester/config/feature-flags.js +++ b/pkg/harvester/config/feature-flags.js @@ -57,6 +57,9 @@ const FEATURE_FLAGS = { 'hotplugNic' ], 'v1.7.1': [], + 'v1.7.2': [ + 'clusterRegistrationTLSVerify' + ], }; const generateFeatureFlags = () => { diff --git a/pkg/harvester/config/settings.ts b/pkg/harvester/config/settings.ts index 6d513e27..fcaeb968 100644 --- a/pkg/harvester/config/settings.ts +++ b/pkg/harvester/config/settings.ts @@ -123,7 +123,8 @@ export const HCI_ALLOWED_SETTINGS = { export const HCI_SINGLE_CLUSTER_ALLOWED_SETTING = { [HCI_SETTING.CLUSTER_REGISTRATION_URL]: { - kind: 'url', + kind: 'custom', + from: 'import', canReset: true, }, [HCI_SETTING.UI_PL]: { diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index 43cd7322..721b3b17 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -1294,6 +1294,12 @@ harvester: retention: How long to retain metrics retentionSize: Maximum size of metrics clusterRegistrationUrl: + url: URL + insecureSkipTLSVerify: Insecure Skip TLS Verify + tip: + prefix: Harvester secures cluster registration via TLS by default. If opt out "Insecure SKip TLS Verify", you must provide custom CA certificates using the + middle: 'additional-ca' + suffix: setting. message: To completely unset the imported Harvester cluster, please also remove it on the Rancher Dashboard UI via the Virtualization Management page. ntpServers: isNotIPV4: The address you entered is not IPv4 or host. Please enter a valid IPv4 address or a host address. diff --git a/pkg/harvester/models/harvesterhci.io.setting.js b/pkg/harvester/models/harvesterhci.io.setting.js index e9650dee..8c6e5488 100644 --- a/pkg/harvester/models/harvesterhci.io.setting.js +++ b/pkg/harvester/models/harvesterhci.io.setting.js @@ -52,11 +52,19 @@ export default class HciSetting extends HarvesterResource { }); } + get clusterRegistrationTLSVerifyFeatureEnabled() { + return this.$rootGetters['harvester-common/getFeatureEnabled']('clusterRegistrationTLSVerify'); + } + get customValue() { if (this.metadata.name === HCI_SETTING.STORAGE_NETWORK) { try { return JSON.stringify(JSON.parse(this.value), null, 2); } catch (e) {} + } else if (this.metadata.name === HCI_SETTING.CLUSTER_REGISTRATION_URL) { + try { + return this.clusterRegistrationTLSVerifyFeatureEnabled ? JSON.stringify(JSON.parse(this.value), null, 2) : this.value; + } catch (e) {} } return false;