forked from inspec/inspec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHEF-16823: Introduce deprecation warning for core resources moving t…
…o resource packs in InSpec 7 (inspec#7219) * chore: add deprecation message for core resource that will be moved as resource pack Signed-off-by: Sonu Saha <[email protected]> * chore: invoke deprecation for docker resources Signed-off-by: Sonu Saha <[email protected]> * chore: invoke deprecation for mongodb resources Signed-off-by: Sonu Saha <[email protected]> * chore: invoke deprecation for rabbitmq resources Signed-off-by: Sonu Saha <[email protected]> * chore: invoke deprecation for ibmdb2 resources Signed-off-by: Sonu Saha <[email protected]> * chore: invoke deprecation for sybase resources Signed-off-by: Sonu Saha <[email protected]> * chore: expect deprecation for docker resources Signed-off-by: Sonu Saha <[email protected]> * chore: expect deprecation for mongodb resources Signed-off-by: Sonu Saha <[email protected]> * chore: expect deprecation for rabbitmq resources Signed-off-by: Sonu Saha <[email protected]> * chore: expect deprecation for ibmdb2 resources Signed-off-by: Sonu Saha <[email protected]> * chore: update keyword to display to change notice for core resources moving to resource pack Signed-off-by: Sonu Saha <[email protected]> * chore: add the common message to be displayed as part of the warning message Signed-off-by: Sonu Saha <[email protected]> * chore: update warning message for the core resources moving to resource pack Signed-off-by: Sonu Saha <[email protected]> * chore: add warning message for elasticsearch resource as it will be moved to resource pack in InSpec 7 Signed-off-by: Sonu Saha <[email protected]> * chore: add warning message for podman resources as it will be moved to resource pack in InSpec 7 Signed-off-by: Sonu Saha <[email protected]> * chore: add warning message for ssh resources as it will be moved to resource pack in InSpec 7 Signed-off-by: Sonu Saha <[email protected]> * spec: update test for ignoring change notice warning Signed-off-by: Sonu Saha <[email protected]> * refactor: invoke warning during loading of the resource Signed-off-by: Sonu Saha <[email protected]> * revert: undo changes to unit test files of core resources Signed-off-by: Sonu Saha <[email protected]> * spec: add functional test to verify warning message and successful run Signed-off-by: Sonu Saha <[email protected]> * chore: add fixture profile for deprecated resource Signed-off-by: Sonu Saha <[email protected]> * chore: update profile fixture for deprecated core resources Signed-off-by: Sonu Saha <[email protected]> * chore: minor cleanup and doc change Signed-off-by: Sonu Saha <[email protected]> --------- Signed-off-by: Sonu Saha <[email protected]>
- Loading branch information
Showing
10 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module DeprecatedCoreResourcesList | ||
CORE_RESOURCES_DEPRECATED = %i{ | ||
docker_container | ||
docker_image | ||
docker_plugin | ||
docker_service | ||
elasticsearch | ||
ibmdb2_conf | ||
ibmdb2_session | ||
mongodb | ||
mongodb_conf | ||
mongodb_session | ||
podman | ||
podman_container | ||
podman_image | ||
podman_network | ||
podman_pod | ||
podman_volume | ||
rabbitmq_config | ||
ssh_config | ||
ssh_key | ||
sybase_conf | ||
sybase_session | ||
}.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# InSpec Profile for Deprecated Resources | ||
|
||
This example demonstrates the implementation of an InSpec profile that includes deprecated resource. |
13 changes: 13 additions & 0 deletions
13
test/fixtures/profiles/deprecated-core-resources/controls/example.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# copyright: 2018, The Authors | ||
|
||
title "sample section" | ||
|
||
control "mongodb_conf" do | ||
impact 1.0 | ||
title "Verifies the configuration of MongoDB" | ||
desc "Verifies the configuration of MongoDB" | ||
|
||
describe mongodb_conf("./test/fixtures/files/mongod.conf") do | ||
its(%w{storage dbPath}) { should eq "/var/lib/mongodb" } | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
test/fixtures/profiles/deprecated-core-resources/inspec.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: deprecated-core-resources | ||
title: InSpec Profile | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: [email protected] | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
supports: | ||
platform: os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters