Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add parser container_inspect #3562

Merged
merged 22 commits into from
Nov 3, 2022
Merged

feat: Add parser container_inspect #3562

merged 22 commits into from
Nov 3, 2022

Conversation

wushiqinlou
Copy link
Contributor

@wushiqinlou wushiqinlou commented Oct 24, 2022

Signed-off-by: jiazhang [email protected]

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

This PR is used to collect the output of "docker|podman inspect " for new advisor rule.

@wushiqinlou wushiqinlou changed the title Add parser container_inspect [draft]Add parser container_inspect Oct 24, 2022
@wushiqinlou wushiqinlou changed the title [draft]Add parser container_inspect feat: Add parser container_inspect Oct 26, 2022
@wushiqinlou
Copy link
Contributor Author

wushiqinlou commented Oct 27, 2022

The content of collected data/insights_commands/containers_inspect is the following:

cat data/insights_commands/containers_inspect

[{"engine": "podman", "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "c11ad088c87b3d2c4ec836999fb2f6b79779db4aca8a505e0dbf3d96faab3f20", "HostConfig": {"Privileged": false}}, {"engine": "podman", "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "5bc85f6218aa7f1752e3b371c460fc1a0198a9fdee3fa66731a7bfebf1d32272", "HostConfig": {"Privileged": true}}, {"engine": "docker", "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "4ebe5a4d62498b5b18c30fb4f85b8960eec08264df6dd73418519330441fc928", "HostConfig": {"Privileged": false}}, {"engine": "docker", "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "c7efee959ea8910d68eaa5038d3ebf62ae593bfe96757b456c06f16281394921", "HostConfig": {"Privileged": true}}]

@wushiqinlou
Copy link
Contributor Author

@xiangce - Please review.

Copy link
Contributor

@xiangce xiangce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the following comments, the "podman_inspect.py" should also be deprecated.

insights/parsers/docker_inspect.py Outdated Show resolved Hide resolved
insights/specs/datasources/containers_inspect.py Outdated Show resolved Hide resolved
insights/specs/datasources/containers_inspect.py Outdated Show resolved Hide resolved
insights/parsers/containers_inspect.py Outdated Show resolved Hide resolved
insights/specs/__init__.py Outdated Show resolved Hide resolved
insights/specs/default.py Outdated Show resolved Hide resolved
insights/specs/datasources/containers_inspect.py Outdated Show resolved Hide resolved
insights/specs/datasources/containers_inspect.py Outdated Show resolved Hide resolved
insights/specs/datasources/containers_inspect.py Outdated Show resolved Hide resolved
insights/parsers/containers_inspect.py Show resolved Hide resolved
@wushiqinlou
Copy link
Contributor Author

@xiangce - I updated this PR according to your comments, please check.

@wushiqinlou
Copy link
Contributor Author

New collected archive:

# cat insights_containers/insights_containers

[{"engine": "podman", "Config|Cmd": ["sleep", "100000"], "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "81b8de0d16ce", "HostConfig|Privileged": false}, {"engine": "podman", "Config|Cmd": ["sleep", "100000"], "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "327202b625d0", "HostConfig|Privileged": false}, {"engine": "docker", "Config|Cmd": ["sleep", "100000"], "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "706c223d3f58", "HostConfig|Privileged": false}, {"engine": "docker", "Config|Cmd": ["sleep", "100000"], "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "a7c6b05025f4", "HostConfig|Privileged": false}, {"engine": "docker", "Config|Cmd": ["sleep", "1000000"], "Image": "acf3e09a39c95d354539b6591298be0b0814f5d74e95e722863241192b9a079b", "Id": "c7efee959ea8", "HostConfig|Privileged": true}]

Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Signed-off-by: jiazhang <[email protected]>
Copy link
Contributor

@xiangce xiangce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending the approval of new specs

@psachin psachin merged commit 66e0d57 into RedHatInsights:master Nov 3, 2022
psachin pushed a commit that referenced this pull request Nov 3, 2022
* Add parser container_inspect

Signed-off-by: jiazhang <[email protected]>

* Update containers_inspect

Signed-off-by: jiazhang <[email protected]>

* Add parser

Signed-off-by: jiazhang <[email protected]>

* Update docs

Signed-off-by: jiazhang <[email protected]>

* Update format and description

Signed-off-by: jiazhang <[email protected]>

* Add back docker_container_inspect

Signed-off-by: jiazhang <[email protected]>

* Add deprecated warning

Signed-off-by: jiazhang <[email protected]>

* Fix string format

Signed-off-by: jiazhang <[email protected]>

* Update test data format

Signed-off-by: jiazhang <[email protected]>

* Update test data

Signed-off-by: jiazhang <[email protected]>

* Update test data

Signed-off-by: jiazhang <[email protected]>

* Update return value format

Signed-off-by: jiazhang <[email protected]>

* Update parser test data

Signed-off-by: jiazhang <[email protected]>

* Update datasource details

Signed-off-by: jiazhang <[email protected]>

* Update filter

Signed-off-by: jiazhang <[email protected]>

* Update docstring

Signed-off-by: jiazhang <[email protected]>

* Update doc

Signed-off-by: jiazhang <[email protected]>

* Update no_filters

Signed-off-by: jiazhang <[email protected]>

* Update default format

Signed-off-by: jiazhang <[email protected]>

* Update deprecated info

Signed-off-by: jiazhang <[email protected]>

* Update set format

Signed-off-by: jiazhang <[email protected]>

* Add a comment for condition checking if total_results is not null

Signed-off-by: jiazhang <[email protected]>

Signed-off-by: jiazhang <[email protected]>
(cherry picked from commit 66e0d57)
xiangce pushed a commit that referenced this pull request Sep 6, 2024
* Add parser container_inspect

Signed-off-by: jiazhang <[email protected]>

* Update containers_inspect

Signed-off-by: jiazhang <[email protected]>

* Add parser

Signed-off-by: jiazhang <[email protected]>

* Update docs

Signed-off-by: jiazhang <[email protected]>

* Update format and description

Signed-off-by: jiazhang <[email protected]>

* Add back docker_container_inspect

Signed-off-by: jiazhang <[email protected]>

* Add deprecated warning

Signed-off-by: jiazhang <[email protected]>

* Fix string format

Signed-off-by: jiazhang <[email protected]>

* Update test data format

Signed-off-by: jiazhang <[email protected]>

* Update test data

Signed-off-by: jiazhang <[email protected]>

* Update test data

Signed-off-by: jiazhang <[email protected]>

* Update return value format

Signed-off-by: jiazhang <[email protected]>

* Update parser test data

Signed-off-by: jiazhang <[email protected]>

* Update datasource details

Signed-off-by: jiazhang <[email protected]>

* Update filter

Signed-off-by: jiazhang <[email protected]>

* Update docstring

Signed-off-by: jiazhang <[email protected]>

* Update doc

Signed-off-by: jiazhang <[email protected]>

* Update no_filters

Signed-off-by: jiazhang <[email protected]>

* Update default format

Signed-off-by: jiazhang <[email protected]>

* Update deprecated info

Signed-off-by: jiazhang <[email protected]>

* Update set format

Signed-off-by: jiazhang <[email protected]>

* Add a comment for condition checking if total_results is not null

Signed-off-by: jiazhang <[email protected]>

Signed-off-by: jiazhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants