Skip to content

Commit

Permalink
Don't show 'Upgrade available' for agents in hosted policies (#97517)
Browse files Browse the repository at this point in the history
## Summary
Close item 3 on #91906. Don't show icon & "upgrade available" for agents in hosted agent policies

### Local testing
I'll try to come back and post the exact commands if anyone wants them, but my rough flow was

1. start ES in 7.13
2. checkout kibana 7.x branch and start
3. create agents in kibana
4. stop kibana & ES
5. start ES in 8.0.0-SNAPSHOT
6. switch to kibana `master` branch & start
7. Navigate to http://localhost:5601/app/fleet#/fleet/agents and observe agents with upgrade available
8. assign agent(s) to a hosted agent policy
9. Observe behavior shown in two screenshots
### Don't show "upgrade available" for hosted agents in list
<img width="947" alt="Screen Shot 2021-04-19 at 3 08 12 PM" src="https://user-images.githubusercontent.com/57655/115291869-421c2480-a123-11eb-9dd2-6e450775c16b.png">

### Don't show agent in list when "Upgrade available" filter is selected
<img width="945" alt="Screen Shot 2021-04-19 at 3 08 40 PM" src="https://user-images.githubusercontent.com/57655/115291870-421c2480-a123-11eb-9309-09e3de8902f8.png">


closes #91906
  • Loading branch information
John Schulz authored and kibanamachine committed Apr 19, 2021
1 parent fb0916c commit 5e514c1
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
<EuiFlexItem grow={false} className="eui-textNoWrap">
{safeMetadata(version)}
</EuiFlexItem>
{isAgentUpgradeable(agent, kibanaVersion) ? (
{isAgentSelectable(agent) && isAgentUpgradeable(agent, kibanaVersion) ? (
<EuiFlexItem grow={false}>
<EuiText color="subdued" size="xs" className="eui-textNoWrap">
<EuiIcon size="m" type="alert" color="warning" />
Expand Down Expand Up @@ -593,7 +593,15 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
emptyPrompt
)
}
items={totalAgents ? agents : []}
items={
totalAgents
? showUpgradeable
? agents.filter(
(agent) => isAgentSelectable(agent) && isAgentUpgradeable(agent, kibanaVersion)
)
: agents
: []
}
itemId="id"
columns={columns}
pagination={{
Expand Down

0 comments on commit 5e514c1

Please sign in to comment.