Skip to content

Fix for --version in osctrl-admin#676

Merged
javuto merged 2 commits intomainfrom
version-cli-admin-fix
Aug 15, 2025
Merged

Fix for --version in osctrl-admin#676
javuto merged 2 commits intomainfrom
version-cli-admin-fix

Conversation

@javuto
Copy link
Collaborator

@javuto javuto commented Aug 15, 2025

Fix for osctrl-admin to print out the version and exit when issuing the -v, --version flag. Also adding metadata to build.

@javuto javuto requested a review from Copilot August 15, 2025 11:51
@javuto javuto added osctrl-admin osctrl-admin related changes 📦 build Building related issues labels Aug 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the --version flag functionality in osctrl-admin by adding proper version handling and build metadata. The changes ensure that when users run osctrl-admin --version or osctrl-admin -v, the application prints version information and exits instead of starting the full service.

  • Adds build-time metadata variables for version, commit, and date information
  • Implements custom version printer and flag handling similar to other services
  • Restructures application flow to prevent service initialization for version/help commands
  • Updates build configuration to include version metadata in compiled binaries

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/admin/main.go Adds version metadata variables, custom version printer, and restructures main flow to handle version flag properly
cmd/tls/main.go Removes unnecessary blank lines for consistency
Makefile Updates admin build targets to include build arguments with version metadata
.goreleaser.yml Updates ldflags to use correct variable names for build metadata injection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Using `buildVersion` to keep consistency

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@javuto javuto merged commit 203b5e8 into main Aug 15, 2025
55 checks passed
@javuto javuto deleted the version-cli-admin-fix branch August 15, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 build Building related issues osctrl-admin osctrl-admin related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants