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

Expose Kopf's version in user-agent & in logs #777

Merged
merged 1 commit into from
May 14, 2021
Merged

Conversation

nolar
Copy link
Owner

@nolar nolar commented May 14, 2021

Show the version in logs on startup:

[2021-05-14 15:06:23,079] kopf._core.reactor.r [DEBUG   ] Starting Kopf 1.32rc1.
[2021-05-14 15:06:23,080] kopf._core.engines.a [INFO    ] Initial authentication has been initiated.
[2021-05-14 15:06:23,080] kopf.activities.auth [DEBUG   ] Activity 'login_via_pykube' is invoked.
………

And in the API request as User-Agent:

User-Agent: kopf/1.32rc1

If a dev-mode version is installed, the version will look like this:

[2021-05-14 15:08:30,213] kopf._core.reactor.r [DEBUG   ] Starting Kopf 1.32rc2.dev22+ga97ef9eb.

All in all, the version is retrieved from the virtualenv — as python/pip/pkg_resources see it. The source code does not store the hard-coded version anywhere.

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar added the enhancement New feature or request label May 14, 2021
@nolar nolar enabled auto-merge May 14, 2021 13:29
@nolar nolar merged commit 39431f6 into main May 14, 2021
@nolar nolar deleted the self-versioning branch May 14, 2021 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant