From b33927d28f2964cd90a67317e93ee7a393660501 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 5 Jul 2023 11:58:23 +0200 Subject: [PATCH 1/2] Add condition to define stack capability requirements --- spec/changelog.yml | 6 +++--- spec/integration/manifest.spec.yml | 19 +++++++++++++++++++ test/packages/good_input/manifest.yml | 3 ++- test/packages/good_v2/manifest.yml | 4 +++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/spec/changelog.yml b/spec/changelog.yml index 76b1ce1e8..8f3389cb5 100644 --- a/spec/changelog.yml +++ b/spec/changelog.yml @@ -2,11 +2,11 @@ ## This file documents changes in the package specification. It is NOT a package specification file. ## Newer entries go at the bottom of each in-development version. ## -- version: 2.9.1-next +- version: 2.10.0-next changes: - - description: Prepare for next version + - description: Packages can define required stack capabilities type: enhancement - link: https://github.com/elastic/package-spec/pull/547 + link: https://github.com/elastic/package-spec/pull/561 - version: 2.9.0 changes: - description: Update minimum kibana version required for runtime fields diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index ff02a3156..8ad6154a8 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -101,6 +101,21 @@ spec: default: basic examples: - basic + capabilities: + description: |- + Stack features that are required by the package to work properly. + The package should not be used in deployments without the indicated features. + Packages that don't indicate any capability condition can be used on any deployment. + type: array + items: + type: string + enum: + - apm + - enterprise_search + - observability + - security + - serverless_search + - uptime kibana: description: Kibana conditions type: object @@ -379,6 +394,10 @@ spec: # JSON patches for newer versions should be placed on top versions: + - before: 2.10.0 + patch: + - op: remove + path: "/definitions/conditions/properties/elastic/properties/capabilities" - before: 2.3.0 patch: - op: add diff --git a/test/packages/good_input/manifest.yml b/test/packages/good_input/manifest.yml index e09730e6b..9b413b4ae 100644 --- a/test/packages/good_input/manifest.yml +++ b/test/packages/good_input/manifest.yml @@ -1,4 +1,4 @@ -format_version: 2.9.0 +format_version: 2.10.0 name: good_input title: good_input description: >- @@ -9,6 +9,7 @@ source: license: "Apache-2.0" conditions: elastic.subscription: basic + elastic.capabilities: [observability] kibana: version: "^8.10.0" categories: diff --git a/test/packages/good_v2/manifest.yml b/test/packages/good_v2/manifest.yml index 24ebe7bc1..cbc60c8de 100644 --- a/test/packages/good_v2/manifest.yml +++ b/test/packages/good_v2/manifest.yml @@ -1,4 +1,4 @@ -format_version: 2.9.0 +format_version: 2.10.0 name: good_v2 title: Good package description: This package is good for format version 2 @@ -9,6 +9,8 @@ source: conditions: kibana.version: '^8.10.0' elastic.subscription: 'basic' + elastic.capabilities: + - observability vars: - name: package_password type: password From 83a5dcb55b35f9e8e9512519afcdf16443169ff2 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 5 Jul 2023 16:11:31 +0200 Subject: [PATCH 2/2] Update spec/integration/manifest.spec.yml Co-authored-by: Mario Rodriguez Molins --- spec/integration/manifest.spec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index 8ad6154a8..eb9d2d3d8 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -107,6 +107,7 @@ spec: The package should not be used in deployments without the indicated features. Packages that don't indicate any capability condition can be used on any deployment. type: array + uniqueItems: true items: type: string enum: