Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move inc to cmd/inc #27

Merged
merged 8 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ jobs:
run: |
mkdir bin

- name: Build static incc
- name: Build static inc
env:
CGO_ENABLED: 0
run: |
go build -o bin ./inc
go build -o bin ./cmd/inc

- name: Build static incus-migrate
if: runner.os == 'Linux'
Expand All @@ -282,7 +282,7 @@ jobs:
- name: Unit tests (inc)
env:
CGO_ENABLED: 0
run: go test -v ./inc/...
run: go test -v ./cmd/inc/...

- name: Unit tests (shared)
env:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ endif

.PHONY: client
client:
go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./inc
go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./cmd/inc
@echo "Incus client built successfully"

.PHONY: incus-agent
Expand Down Expand Up @@ -245,7 +245,7 @@ update-pot:
ifeq "$(INCUS_OFFLINE)" ""
(cd / ; go install -v -x github.com/snapcore/snapd/i18n/[email protected])
endif
xgettext-go -o po/$(DOMAIN).pot --add-comments-tag=TRANSLATORS: --sort-output --package-name=$(DOMAIN) [email protected] --keyword=i18n.G --keyword-plural=i18n.NG inc/*.go inc/*/*.go
xgettext-go -o po/$(DOMAIN).pot --add-comments-tag=TRANSLATORS: --sort-output --package-name=$(DOMAIN) [email protected] --keyword=i18n.G --keyword-plural=i18n.NG cmd/inc/*.go internal/cliconfig/*.go

.PHONY: build-mo
build-mo: $(MOFILES)
Expand Down Expand Up @@ -273,5 +273,5 @@ endif
run-parts --exit-on-error --regex '.sh' test/lint

.PHONY: tags
tags: *.go incus/*.go shared/*.go inc/*.go
tags: *.go incus/*.go shared/*.go cmd/inc/*.go
find . -type f -name '*.go' | xargs gotags > tags
2 changes: 1 addition & 1 deletion inc/action.go → cmd/inc/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/spf13/cobra"

"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/copy.go → cmd/inc/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/info.go → cmd/inc/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"gopkg.in/yaml.v2"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
2 changes: 1 addition & 1 deletion inc/init.go → cmd/inc/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"gopkg.in/yaml.v2"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
"github.com/cyphar/incus/shared/i18n"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/list.go → cmd/inc/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/spf13/cobra"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
"github.com/cyphar/incus/incus/instance/instancetype"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/main.go → cmd/inc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
cli "github.com/cyphar/incus/shared/cmd"
"github.com/cyphar/incus/shared/i18n"
Expand Down
2 changes: 1 addition & 1 deletion inc/main_aliases.go → cmd/inc/main_aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"strings"

"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/i18n"
)
Expand Down
2 changes: 1 addition & 1 deletion inc/main_test.go → cmd/inc/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
)

type aliasTestcase struct {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/move.go → cmd/inc/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/rebuild.go → cmd/inc/rebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
2 changes: 1 addition & 1 deletion inc/remote.go → cmd/inc/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"golang.org/x/term"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
cli "github.com/cyphar/incus/shared/cmd"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion inc/utils.go → cmd/inc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared"
"github.com/cyphar/incus/shared/api"
"github.com/cyphar/incus/shared/i18n"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/incus-benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/cyphar/incus/client"
"github.com/cyphar/incus/inc/config"
config "github.com/cyphar/incus/internal/cliconfig"
"github.com/cyphar/incus/shared/api"
"github.com/cyphar/incus/shared/version"
)
Expand Down
2 changes: 1 addition & 1 deletion inc/config/cert.go → internal/cliconfig/cert.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion inc/config/config.go → internal/cliconfig/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

import (
"encoding/json"
Expand Down
2 changes: 1 addition & 1 deletion inc/config/default.go → internal/cliconfig/default.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

// LocalRemote is the default local remote (over the LXD unix socket).
var LocalRemote = Remote{
Expand Down
2 changes: 1 addition & 1 deletion inc/config/errors.go → internal/cliconfig/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion inc/config/file.go → internal/cliconfig/file.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion inc/config/remote.go → internal/cliconfig/remote.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package cliconfig

import (
"crypto/x509"
Expand Down
2 changes: 1 addition & 1 deletion test/lint/client-imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Checking for imports that have been added to client or shared..."

OUT=$(go list -f '{{ join .Imports "\n" }}' ./client ./shared/api ./inc/config | grep -F . | sort -u | diff -u test/godeps.list - || true)
OUT=$(go list -f '{{ join .Imports "\n" }}' ./client ./shared/api ./internal/cliconfig | grep -F . | sort -u | diff -u test/godeps.list - || true)
if [ -n "${OUT}" ]; then
echo "ERROR: you added a new dependency to the client or shared; please make sure this is what you want"
echo "${OUT}"
Expand Down