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

chore: extract code to new library #1109

Merged
merged 11 commits into from
Nov 22, 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
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
go-version: '^1.20'
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
- name: Verify Codegen
run: make verify-codegen
- name: Run tests with Coverage
run: make coverage
- name: Upload Code Coverage
Expand Down
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ lint:
build:
CGO_ENABLED=0 go build -o deck main.go

.PHONY: verify-codegen
verify-codegen:
./scripts/verify-codegen.sh
./scripts/verify-deepcopy-gen.sh

.PHONY: update-codegen
update-codegen:
./scripts/update-deepcopy-gen.sh
go generate ./...

.PHONY: coverage
coverage:
go test -race -v -count=1 -coverprofile=coverage.out.tmp ./...
Expand All @@ -49,4 +39,4 @@ setup-kong-ee:
test-integration:
go test -v -count=1 -tags=integration \
-race \
./tests/integration/...
./tests/integration/...
12 changes: 6 additions & 6 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"sort"

"github.com/blang/semver/v4"
"github.com/kong/deck/cprint"
"github.com/kong/deck/diff"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
12 changes: 6 additions & 6 deletions cmd/common_konnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"os"
"strings"

"github.com/kong/deck/diff"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/konnect"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/konnect"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"golang.org/x/sync/errgroup"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/common_konnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"testing"

"github.com/kong/deck/konnect"
"github.com/kong/go-database-reconciler/pkg/konnect"
"github.com/kong/go-kong/kong"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
)

func TestDetermineSelectorTag(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/file_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"

"github.com/kong/deck/convert"
"github.com/kong/deck/cprint"
"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/file_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/kong/deck/convert"
"github.com/kong/deck/file"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/gateway_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"strings"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"os"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/deck/validate"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/konnect.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/kong/deck/cprint"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/konnect_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/konnect_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"

"github.com/fatih/color"
"github.com/kong/deck/utils"
"github.com/kong/go-apiops/deckformat"
"github.com/kong/go-database-reconciler/pkg/utils"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/fatih/color"
"github.com/kong/deck/cprint"
"github.com/kong/deck/diff"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/spf13/pflag"
)

Expand Down
10 changes: 5 additions & 5 deletions convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"strings"

"github.com/blang/semver/v4"
"github.com/kong/deck/cprint"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
)

Expand Down
4 changes: 2 additions & 2 deletions convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/stretchr/testify/assert"
)
Expand Down
77 changes: 0 additions & 77 deletions cprint/color.go

This file was deleted.

Loading