File tree 3 files changed +14
-6
lines changed 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ RUN go mod verify
17
17
RUN find .
18
18
19
19
# Build the binary.
20
- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X github.com/civo/civo-csi/driver.CSIVersion =${VERSION}" -o /app/civo-csi
20
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X github.com/civo/civo-csi/pkg/ driver.Version =${VERSION}" -o /app/civo-csi
21
21
22
22
23
23
# ###########################
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"context"
5
+ "flag"
5
6
"os"
6
7
"os/signal"
7
8
"strings"
@@ -13,10 +14,20 @@ import (
13
14
"github.com/rs/zerolog/log"
14
15
)
15
16
17
+ var (
18
+ versionInfo = flag .Bool ("version" , false , "Print the driver version" )
19
+ )
20
+
16
21
func main () {
17
22
zerolog .TimeFieldFormat = zerolog .TimeFormatUnix
18
23
log .Logger = log .Output (zerolog.ConsoleWriter {Out : os .Stderr })
19
24
25
+ flag .Parse ()
26
+ if * versionInfo {
27
+ log .Info ().Str ("version" , driver .Version ).Msg ("CSI driver" )
28
+ return
29
+ }
30
+
20
31
apiURL := strings .TrimSpace (os .Getenv ("CIVO_API_URL" ))
21
32
apiKey := strings .TrimSpace (os .Getenv ("CIVO_API_KEY" ))
22
33
region := strings .TrimSpace (os .Getenv ("CIVO_REGION" ))
Original file line number Diff line number Diff line change @@ -17,14 +17,11 @@ import (
17
17
"google.golang.org/grpc"
18
18
)
19
19
20
- // CSIVersion is the version of the csi to set in the User-Agent header
21
- var CSIVersion = "dev"
22
-
23
20
// Name is the name of the driver
24
21
const Name string = "Civo CSI Driver"
25
22
26
- // Version is the current release of the driver
27
- const Version string = "0.0.1"
23
+ // Version is the current version of the driver to set in the User-Agent header
24
+ var Version string = "0.0.1"
28
25
29
26
// DefaultVolumeSizeGB is the default size in Gigabytes of an unspecified volume
30
27
const DefaultVolumeSizeGB int = 10
You can’t perform that action at this time.
0 commit comments