Skip to content

Commit

Permalink
Merge pull request #3587 from dougm/vim-version
Browse files Browse the repository at this point in the history
govc: support use of service version via GOVC_VIM_VERSION env var
  • Loading branch information
dougm authored Oct 9, 2024
2 parents a11d573 + 2bbc6d8 commit 892dbcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion govc/flags/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (flag *ClientFlag) Client() (*vim25.Client, error) {
return nil, err
}

if flag.vimVersion == "" {
if flag.vimVersion == "" || flag.vimVersion == "-" {
err = c.UseServiceVersion()
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions govc/test/cli.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ load test_helper
version=$(govc about -json -c -vim-version "" | jq -r .client.version)
assert_equal uE53DA "$version" # vcsim's service version

version=$(env GOVC_VIM_VERSION=- govc about -json -c | jq -r .client.version)
assert_equal uE53DA "$version" # vcsim's service version

version=$(govc about -json -c -vim-version 6.8.2 | jq -r .client.version)
assert_equal 6.8.2 "$version" # client specified version

Expand Down

0 comments on commit 892dbcf

Please sign in to comment.