Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Add agent tls mode to global settings (#11287) #11607

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7129,6 +7129,9 @@ advancedSettings:
'ui-default-landing': 'The default page users land on after login.'
'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."
warnings:
'agent-tls-mode': 'Changing this setting will cause all agents to be redeployed.'
editHelp:
'ui-banners': This setting takes a JSON object containing 3 root parameters; <code>banner</code>, <code>showHeader</code>, <code>showFooter</code>. <code>banner</code> is an object containing; <code>textColor</code>, <code>background</code>, and <code>text</code>, where <code>textColor</code> and <code>background</code> are any valid CSS color value.
enum:
Expand All @@ -7151,6 +7154,9 @@ advancedSettings:
info: Info
debug: Debug
trace: Trace
'agent-tls-mode':
strict: 'Strict'
system-store: 'System Store'

featureFlags:
label: Feature Flags
Expand Down
11 changes: 9 additions & 2 deletions shell/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ interface GlobalSetting {
/**
* Function used from the form validation
*/
ruleSet?: GlobalSettingRuleset[],
ruleSet?: GlobalSettingRuleset[],
warning?: string
};
}

Expand Down Expand Up @@ -90,8 +91,9 @@ export const SETTING = {
FLEET_AGENT_DEFAULT_AFFINITY: 'fleet-agent-default-affinity',
/**
* manage rancher repositories in extensions (official, partners repos)
*/
*/
ADD_EXTENSION_REPOS_BANNER_DISPLAY: 'display-add-extension-repos-banner',
AGENT_TLS_MODE: 'agent-tls-mode',
/**
* User retention settings
*/
Expand Down Expand Up @@ -152,6 +154,11 @@ export const ALLOWED_SETTINGS: GlobalSetting = {
options: ['prompt', 'in', 'out']
},
[SETTING.HIDE_LOCAL_CLUSTER]: { kind: 'boolean' },
[SETTING.AGENT_TLS_MODE]: {
kind: 'enum',
options: ['strict', 'system-store'],
warning: 'agent-tls-mode'
},
};

/**
Expand Down
17 changes: 15 additions & 2 deletions shell/edit/management.cattle.io.setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { LabeledInput } from '@components/Form/LabeledInput';
import LabeledSelect from '@shell/components/form/LabeledSelect';
import CreateEditView from '@shell/mixins/create-edit-view';
import { TextAreaAutoGrow } from '@components/Form/TextArea';
import { Banner } from '@components/Banner';
import formRulesGenerator from '@shell/utils/validators/formRules/index';

import { ALLOWED_SETTINGS, SETTING } from '@shell/config/settings';
Expand All @@ -18,7 +19,8 @@ export default {
LabeledInput,
LabeledSelect,
RadioGroup,
TextAreaAutoGrow
TextAreaAutoGrow,
Banner,
},

mixins: [CreateEditView, FormValidation],
Expand Down Expand Up @@ -63,7 +65,11 @@ export default {

return factoryArg ? rule(factoryArg) : rule;
}) : {};
}
},

showWarningBanner() {
return this.setting?.warning;
},
},

methods: {
Expand Down Expand Up @@ -118,6 +124,13 @@ export default {
@finish="saveSettings"
@cancel="done"
>
<Banner
v-if="showWarningBanner"
color="warning"
:label="t(`advancedSettings.warnings.${ setting.warning }`)"
data-testid="advanced_settings_warning_banner"
/>

<h4>{{ description }}</h4>

<h5
Expand Down
Loading