Skip to content

Commit

Permalink
Merge branch 'main' into print_yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeimer authored Oct 10, 2024
2 parents 94d450c + 7dad6ac commit 529e94c
Show file tree
Hide file tree
Showing 9 changed files with 793 additions and 1,100 deletions.
13 changes: 13 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"default": true,
"MD003": { "style": "atx" },
"MD004": false,
"MD007": false,
"MD010": {"code_blocks": false},
"MD013": false,
"MD026": {"punctuation": ".,;!。,;:!"},
"MD029": false,
"MD051": false,
"no-hard-tabs": false,
"whitespace": false
}
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ repos:
rev: v1.11.2
hooks:
- id: mypy
exclude: (tests/*)
exclude: (tests/)
additional_dependencies: [types-PyYAML]

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.14.0
hooks:
- id: markdownlint-cli2
8 changes: 3 additions & 5 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"tagAnnotation": "Release ${version}",
"tagArgs": [],
"push": true,
"pushArgs": [
"--follow-tags"
],
"pushArgs": ["--follow-tags"],
"pushRepo": "",
"changelog": "git log --no-merges --pretty=format:\"* %s (%h) by %an on %as\" ${from}...${to}"
},
Expand All @@ -40,8 +38,8 @@
},
"plugins": {
"@release-it/bumper": {
"in": "VERSION",
"out": "VERSION"
"in": "pyproject.toml",
"out": { "file": "pyproject.toml", "path": "project.version" }
}
}
}
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# Must-gather explorer

Explore the collected must-gather data

## Prerequisite
Install [pipx](https://github.com/pypa/pipx)

Install [uv](https://github.com/astral-sh/uv)

## Installation

```bash
pipx install must-gather-explorer
uv tool install must-gather-explorer
```

After successful installation, these CLI tools will be available:

- must-gather-explorer
- update-resources-aliases
- must-gather-explorer-update-aliases

## How to use

- Run the command:

```bash
must-gather-explorer --path=<path-to-must-gather-folder>
```

Once you executed the command, you will enter the must-gather-explorer shell `Enter the command:`, where you can prompt these commands:

- Get the resources:

```bash
get <resource_kind:mandatory> <-n namespace_name:optional> <resource_name_starts_with:optional>
```

- Example:

```bash
get Node # To get all Nodes
get PersistentVolumeClaim hpp # To get all PVCs when name starts from 'hpp'
Expand All @@ -33,19 +45,24 @@ get pvc -n openshift-storage hpp # To get all PVCs in 'openshift-storage' namesp
get pvc hpp yaml # To print yamls of all PVCs when name starts from 'hpp'
get pvc -n openshift-storage hpp yaml # To print yamls of all PVCs in 'openshift-storage' namespace when name starts from 'hpp'
```

- Help:

```bash
help
```

- Exit:

```bash
exit
```

## Update cluster resources aliases

- Need to be logged-in to the OpenShift cluster or have exported KUBECONFIG
- Run the command:

```bash
update-resources-aliases
must-gather-explorer-update-aliases
```
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1,067 changes: 0 additions & 1,067 deletions poetry.lock

This file was deleted.

40 changes: 19 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,31 @@ no_implicit_optional = true
show_error_codes = true
warn_unused_ignores = true

[tool.poetry]
[project]
name = "must-gather-explorer"
version = "0.1.0"
version = "0.1.2"
description = "Tool to explore must-gather data"
authors = ["Jenia Peimer <[email protected]>"]
license = "Apache-2.0 license"
authors = [{ "name" = "Jenia Peimer", "email" = "[email protected]" }]
license = { "text" = "Apache-2.0 license" }
readme = "README.md"
packages = [{ include = "app" }]
requires-python = ">=3.9"
dependencies = [
"click>=8.1.7",
"pyhelper-utils>=0.0.42",
"pyyaml>=6.0.2",
"rich>=13.9.2",
]

[tool.poetry.dependencies]
python = "^3.9"
pyyaml = "^6.0.2"
click = "^8.1.7"
rich = "^13.8.0"
poetry-dynamic-versioning = "^1.4.1"
pyhelper-utils = "^0.0.42"
[tool.hatch.build.targets.wheel]
packages = ["app"]


[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.13"

[tool.poetry-dynamic-versioning.substitution]
files = ["VERSION"]
[tool.uv]
dev-dependencies = ["ipdb>=0.13.13", "ipython>=8.18.1"]

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.scripts]
[project.scripts]
must-gather-explorer = "app.main:main"
must-gather-explorer-update-aliases = "app.resource_aliases:fill_api_resources_aliases"
10 changes: 9 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{"$schema": "https://docs.renovatebot.com/renovate-schema.json", "packageRules": [{"matchPackagePatterns": ["pyyaml", "click", "ipdb"], "groupName": "poetry-deps"}]}
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"matchPackagePatterns": ["*"],
"groupName": "app-deps"
}
]
}
722 changes: 722 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 529e94c

Please sign in to comment.