Skip to content

I cannot check the version of the running binary (controller, cainjector, webhook, acmesolver, and startupapicheck) #8067

@maelvls

Description

@maelvls

We do embed the version of cert-manager in each of the binaries using -ldflags. Unfortunately, the version string can never be printed out because the following line, which is the only line where we make use of util.AppVersion, isn't reachable:

Short: fmt.Sprintf("Automated TLS controller for Kubernetes (%s) (%s)", util.AppVersion, util.AppGitCommit),

The reason is because Short will only ever be printed if that command is a subcommand, and Short will only appear when calling --help on the root command. But since NewServerCommand is the root command, Short can't be printed out.

Example:

$ docker run -it --rm quay.io/jetstack/cert-manager-controller:v1.18.2 --help | head

cert-manager is a Kubernetes addon to automate the management and issuance of
TLS certificates from various issuing sources.

It will ensure certificates are valid and up to date periodically, and attempt
to renew certificates at an appropriate time before expiry.

Usage:
  controller [flags]

/kind feature

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions