Skip to content

Commit

Permalink
govc: Move govc commands into cli pkg
Browse files Browse the repository at this point in the history
This patch refactors the `govc` command so all of its actual logic
and commands are located in the root GoVmomi module under the `cli`
package. The `govc` package may still be used to build, install,
and test `govc`, but this change allows others to import the pieces
of `govc` without being beholden to the `govc` module's Golang
version.

Signed-off-by: akutz <[email protected]>

BREAKING: All packages `./govc/*` (except `./govc/test`) have been
relocated under the `./cli` package.
  • Loading branch information
akutz committed Nov 19, 2024
1 parent a0a0072 commit 7e17885
Show file tree
Hide file tree
Showing 467 changed files with 929 additions and 965 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ builds:
- s390x
env:
- CGO_ENABLED=0
- PKGPATH=github.com/vmware/govmomi/govc/flags
- PKGPATH=github.com/vmware/govmomi/cli/flags
dir: ./govc
main: .
binary: govc
Expand Down
4 changes: 2 additions & 2 deletions govc/about/cert.go → cli/about/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"net/http"
"os"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25/soap"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/about/command.go → cli/about/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"io"
"text/tabwriter"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/soap"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/alarm/create.go → cli/alarm/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"fmt"

"github.com/vmware/govmomi/alarm"
"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
Expand Down
4 changes: 2 additions & 2 deletions govc/alarm/info.go → cli/alarm/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"text/tabwriter"

"github.com/vmware/govmomi/alarm"
"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/mo"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/alarm/rm.go → cli/alarm/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/alarm/state.go → cli/alarm/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"time"

"github.com/vmware/govmomi/alarm"
"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/add.go → cli/cluster/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/object"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/change.go → cli/cluster/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"strings"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/create.go → cli/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"io"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/draft/commit.go → cli/cluster/draft/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/cis/tasks"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"io"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"io"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/draft/create.go → cli/cluster/draft/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"io"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/draft/info.go → cli/cluster/draft/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"io"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/draft/ls.go → cli/cluster/draft/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"io"
"strings"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/draft/rm.go → cli/cluster/draft/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/esx/settings/clusters"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
2 changes: 1 addition & 1 deletion govc/cluster/group/ls.go → cli/cluster/group/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"text/tabwriter"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
vapicluster "github.com/vmware/govmomi/vapi/cluster"
)

Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/module/ls.go → cli/cluster/module/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"io"
"text/tabwriter"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/cluster"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/module/rm.go → cli/cluster/module/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"os"
"strings"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/cluster"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/cluster"
"github.com/vmware/govmomi/vim25/mo"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/module/vm_rm.go → cli/cluster/module/vm_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vapi/cluster"
"github.com/vmware/govmomi/vim25/mo"
)
Expand Down
4 changes: 2 additions & 2 deletions govc/cluster/mv.go → cli/cluster/mv.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"flag"
"fmt"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/object"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"flag"
"strings"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/cluster"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/cluster"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"text/tabwriter"
"time"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25/types"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/govc/flags"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
2 changes: 1 addition & 1 deletion govc/cluster/rule/change.go → cli/cluster/rule/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
2 changes: 1 addition & 1 deletion govc/cluster/rule/create.go → cli/cluster/rule/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"flag"

"github.com/vmware/govmomi/govc/cli"
"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/vim25/types"
)

Expand Down
Loading

0 comments on commit 7e17885

Please sign in to comment.