Skip to content

Commit

Permalink
Created a runtime flag to print out the version for release verification
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Wilkerson <[email protected]>
  • Loading branch information
wilkermichael committed Feb 28, 2024
1 parent 1f0cb57 commit df08cb8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
package main

import (
"flag"
"fmt"

"github.com/argoproj-labs/rollouts-plugin-trafficrouter-consul/pkg/plugin"

"github.com/argoproj-labs/rollouts-plugin-trafficrouter-consul/pkg/version"
rolloutsPlugin "github.com/argoproj/argo-rollouts/rollout/trafficrouting/plugin/rpc"
goPlugin "github.com/hashicorp/go-plugin"
log "github.com/sirupsen/logrus"
Expand All @@ -22,6 +26,15 @@ var handshakeConfig = goPlugin.HandshakeConfig{
}

func main() {
// Create a flag to print the version of the plugin
// This is useful for debugging and support
versionFlag := flag.Bool("version", false, "Print the version of the plugin")
flag.Parse()
if *versionFlag {
fmt.Println(version.GetHumanVersion())
return
}

logCtx := log.WithFields(log.Fields{"plugin": "trafficrouter"})
log.SetLevel(log.InfoLevel)

Expand Down

0 comments on commit df08cb8

Please sign in to comment.