Skip to content

Commit

Permalink
Merge pull request #11607 from jordojordo/11488-backport
Browse files Browse the repository at this point in the history
[Backport] Add agent tls mode to global settings (#11287)
  • Loading branch information
rak-phillip authored Aug 8, 2024
2 parents 7b02680 + 3a0f965 commit af56c27
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
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

0 comments on commit af56c27

Please sign in to comment.