Skip to content

Commit

Permalink
Add --version command line option (#40)
Browse files Browse the repository at this point in the history
* Add --version command line option
* Set version to 1.0.0
  • Loading branch information
jdumalaonITRS authored Apr 21, 2022
1 parent d2bcc4a commit 0810db9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ optional arguments:
Resource to monitor
--namespace NAMESPACE
Look only within this namespace
--version show program's version number and exit
```

Expand Down
8 changes: 8 additions & 0 deletions k8s/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from enum import Enum

from .components import MAPPINGS
from k8s.consts import VERSION


class Default(Enum):
Expand Down Expand Up @@ -111,6 +112,13 @@ class Default(Enum):
"help": "Look only within this namespace",
},
),
(
"--version",
{
"action": "version",
"version": "%(prog)s {}".format(VERSION),
},
),
]


Expand Down
2 changes: 2 additions & 0 deletions k8s/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
RESULT_CRITICAL = "One or more errors encountered"
RESULT_WARNING = "One or more warnings encountered"

VERSION = "1.0.0"


class NaemonState(Enum):
OK = 0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "check_k8s"
version = "0.1.0"
version = "1.0.0"
description = "Kubernetes monitoring plugin"
authors = ["Robert Wikman <[email protected]>"]
license = "GPL-2.0"
Expand Down

0 comments on commit 0810db9

Please sign in to comment.