Skip to content

Commit

Permalink
Allow to override default deployment mode (#854)
Browse files Browse the repository at this point in the history
Add a setting that allows to make agentless the default deployment mode
in cases where a policy template has multiple deployment modes enabled.
  • Loading branch information
jsoriano authored Jan 14, 2025
1 parent 859b6f8 commit 8f12924
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
- description: Add support for Agentless resources.
type: enhancement
link: https://github.com/elastic/package-spec/pull/853
- description: Allow to override default deployment mode.
type: enhancement
link: https://github.com/elastic/package-spec/pull/854
- version: 3.3.1
changes:
- description: Add validation rule to ensure security capability is added if there is any security rule asset.
Expand Down
18 changes: 18 additions & 0 deletions spec/integration/manifest.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ spec:
type: object
properties:
enabled:
description: >
Indicates if the default deployment mode is available for this template policy.
It is enabled by default.
type: boolean
default: true
agentless:
Expand All @@ -173,6 +176,15 @@ spec:
additionalProperties: false
properties:
enabled:
description: >
Indicates if the agentless deployment mode is available for this template policy.
It is disabled by default.
type: boolean
default: false
is_default:
description: >
On policy templates that support multiple deployment modes, this setting can be set to
true to use agentless mode by default.
type: boolean
default: false
organization:
Expand Down Expand Up @@ -577,6 +589,12 @@ spec:

# JSON patches for newer versions should be placed on top
versions:
- before: 3.3.2
patch:
- op: remove
path: "/definitions/deployment_modes/properties/agentless/properties/is_default"
- op: remove
path: "/definitions/deployment_modes/properties/agentless/properties/resources"
- before: 3.3.1
patch:
- op: remove
Expand Down
2 changes: 1 addition & 1 deletion test/packages/bad_deployment_mode_resources/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
format_version: 3.2.2
format_version: 3.3.2
name: bad_deployment_mode
title: "Bad Deployment Mode"
version: 0.0.1
Expand Down
1 change: 1 addition & 0 deletions test/packages/good_v3/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ policy_templates:
deployment_modes:
agentless:
enabled: true
is_default: true
organization: elastic
division: observability
team: obs-infraobs-integrations
Expand Down

0 comments on commit 8f12924

Please sign in to comment.