Skip to content

Commit

Permalink
add new setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mo Mesgin authored and Mo Mesgin committed Oct 18, 2024
1 parent 24f3a76 commit 88e3627
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cypress/e2e/blueprints/global_settings/settings-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export const settings = {
'hide-local-cluster': {
original: 'false',
new: 'true'
},
'k3s-based-upgrader-uninstall-concurrency': {
original: '5',
new: '10'
}
};
export const serverUrlLocalhostCases = [
Expand Down
36 changes: 36 additions & 0 deletions cypress/e2e/tests/pages/global-settings/settings-p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,42 @@ describe('Settings', { testIsolation: 'off' }, () => {
settingsPage.settingsValue('hide-local-cluster').contains(settings['hide-local-cluster'].original);
});

it('can update k3s-based-upgrader-uninstall-concurrency', { tags: ['@globalSettings', '@adminUser'] }, () => {
// Update setting
SettingsPagePo.navTo();
settingsPage.editSettingsByLabel('k3s-based-upgrader-uninstall-concurrency');

const settingsEdit = settingsPage.editSettings('local', 'k3s-based-upgrader-uninstall-concurrency');

settingsEdit.waitForPage();
settingsEdit.title().contains('Setting: k3s-based-upgrader-uninstall-concurrency').should('be.visible');
settingsEdit.settingsInput().set(settings['k3s-based-upgrader-uninstall-concurrency'].new);
settingsEdit.saveAndWait('k3s-based-upgrader-uninstall-concurrency').then(({ request, response }) => {
expect(response?.statusCode).to.eq(200);
expect(request.body).to.have.property('value', settings['k3s-based-upgrader-uninstall-concurrency'].new);
expect(response?.body).to.have.property('value', settings['k3s-based-upgrader-uninstall-concurrency'].new);
});
settingsPage.waitForPage();
settingsPage.settingsValue('k3s-based-upgrader-uninstall-concurrency').contains(settings['k3s-based-upgrader-uninstall-concurrency'].new);

// Reset
SettingsPagePo.navTo();
settingsPage.waitForPage();
settingsPage.editSettingsByLabel('k3s-based-upgrader-uninstall-concurrency');

settingsEdit.waitForPage();
settingsEdit.title().contains('Setting: k3s-based-upgrader-uninstall-concurrency').should('be.visible');
settingsEdit.useDefaultButton().click();
settingsEdit.saveAndWait('k3s-based-upgrader-uninstall-concurrency').then(({ request, response }) => {
expect(response?.statusCode).to.eq(200);
expect(request.body).to.have.property('value', settings['k3s-based-upgrader-uninstall-concurrency'].original);
expect(response?.body).to.have.property('value', settings['k3s-based-upgrader-uninstall-concurrency'].original);
});

settingsPage.waitForPage();
settingsPage.settingsValue('k3s-based-upgrader-uninstall-concurrency').contains(settings['k3s-based-upgrader-uninstall-concurrency'].original);
});

it.skip('[Vue3 Skip]: can update system-default-registry', { tags: ['@globalSettings', '@adminUser'] }, () => {
// Update setting
SettingsPagePo.navTo();
Expand Down
1 change: 1 addition & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7413,6 +7413,7 @@ advancedSettings:
'brand': Folder name for an alternative theme defined in '/assets/brand'
'hide-local-cluster': Hide the local cluster
'agent-tls-mode': "Rancher Certificate Verification. In `strict` mode the agents (system, cluster, fleet, etc) will only trust Rancher installations which are using a certificate signed by the CABundle in the `cacerts` setting. When the mode is system-store, the agents will trust any certificate signed by a CABundle in the operating system’s trust store."
'k3s-based-upgrader-uninstall-concurrency': Defines the maximum number of clusters in which Rancher can concurrently uninstall the legacy rancher-k3s-upgrader or rancher-rke2-upgrader app from imported K3s or RKE2 clusters.
warnings:
'agent-tls-mode': 'Changing this setting will cause all agents to be redeployed.'
editHelp:
Expand Down
5 changes: 5 additions & 0 deletions shell/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const SETTING = {
USER_LAST_LOGIN_DEFAULT: 'user-last-login-default',
DISABLE_INACTIVE_USER_AFTER: 'disable-inactive-user-after',
DELETE_INACTIVE_USER_AFTER: 'delete-inactive-user-after',
K3S_UPGRADER_UNINSTALL_CONCURRENCY: 'k3s-based-upgrader-uninstall-concurrency'
} as const;

// These are the settings that are allowed to be edited via the UI
Expand Down Expand Up @@ -165,6 +166,10 @@ export const ALLOWED_SETTINGS: GlobalSetting = {
options: ['strict', 'system-store'],
warning: 'agent-tls-mode'
},
[SETTING.K3S_UPGRADER_UNINSTALL_CONCURRENCY]: {
kind: 'integer',
ruleSet: [{ name: 'minValue', factoryArg: 1 }]
}
};

/**
Expand Down

0 comments on commit 88e3627

Please sign in to comment.