mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Fleet UI: Surface how to override modifying agent options that are invalid (#8561)
This commit is contained in:
parent
caf3a6e5ef
commit
9f160c058f
@ -0,0 +1 @@
|
||||
- When submitting invalid agent options, inform user how to override agent options using fleetctl force flag
|
@ -82,9 +82,24 @@ const OrgSettingsForm = ({
|
||||
"Could not connect to SMTP server. Please try again."
|
||||
);
|
||||
} else if (response?.data.errors) {
|
||||
const agentOptionsInvalid =
|
||||
response.data.errors[0].reason.includes(
|
||||
"unsupported key provided"
|
||||
) ||
|
||||
response.data.errors[0].reason.includes("invalid value type");
|
||||
|
||||
renderFlash(
|
||||
"error",
|
||||
`Could not update settings. ${response.data.errors[0].reason}`
|
||||
<>
|
||||
Could not update settings. {response.data.errors[0].reason}
|
||||
{agentOptionsInvalid && (
|
||||
<>
|
||||
<br />
|
||||
If you’re not using the latest osquery, use the fleetctl
|
||||
apply --force command to override validation.
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
})
|
||||
|
@ -109,9 +109,24 @@ const AgentOptionsPage = ({
|
||||
})
|
||||
.catch((response: { data: IApiError }) => {
|
||||
console.error(response);
|
||||
|
||||
const agentOptionsInvalid =
|
||||
response.data.errors[0].reason.includes("unsupported key provided") ||
|
||||
response.data.errors[0].reason.includes("invalid value type");
|
||||
|
||||
return renderFlash(
|
||||
"error",
|
||||
`Could not update ${teamName} team agent options. ${response.data.errors[0].reason}`
|
||||
<>
|
||||
Could not update {teamName} team agent options.{" "}
|
||||
{response.data.errors[0].reason}
|
||||
{agentOptionsInvalid && (
|
||||
<>
|
||||
<br />
|
||||
If you’re not using the latest osquery, use the fleetctl apply
|
||||
--force command to override validation.
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user