mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] Always create agent policy as active (#97874)
This commit is contained in:
parent
78c0c6eb83
commit
ee7ba71b43
2 changed files with 4 additions and 0 deletions
|
@ -212,6 +212,7 @@ class AgentPolicyService {
|
|||
SAVED_OBJECT_TYPE,
|
||||
{
|
||||
...agentPolicy,
|
||||
status: 'active',
|
||||
is_managed: agentPolicy.is_managed ?? false,
|
||||
revision: 1,
|
||||
updated_at: new Date().toISOString(),
|
||||
|
|
|
@ -34,6 +34,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
const { body } = await supertest.get(`/api/fleet/agent_policies/${createdPolicy.id}`);
|
||||
expect(body.item.is_managed).to.equal(false);
|
||||
expect(body.item.status).to.be('active');
|
||||
});
|
||||
|
||||
it('sets given is_managed value', async () => {
|
||||
|
@ -140,6 +141,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
expect(newPolicy).to.eql({
|
||||
name: 'Copied policy',
|
||||
status: 'active',
|
||||
description: 'Test',
|
||||
is_managed: false,
|
||||
namespace: 'default',
|
||||
|
@ -242,6 +244,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const { id, updated_at, ...newPolicy } = updatedPolicy;
|
||||
|
||||
expect(newPolicy).to.eql({
|
||||
status: 'active',
|
||||
name: 'Updated name',
|
||||
description: 'Updated description',
|
||||
namespace: 'default',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue