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

fix: Ensure APIs can be used by other Go modules #56

Merged
merged 1 commit into from
Aug 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ generate: $(protoc_bin) generate-stackgres-crds ## Generate code with controller
rm -rf crds && cp -r apis/generated crds
go run sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=appcat paths="{./apis/...,./pkg/apiserver/...}" output:artifacts:config=config/apiserver
go run k8s.io/code-generator/cmd/go-to-protobuf \
--packages=github.com/vshn/appcat/apis/appcat/v1 \
--packages=github.com/vshn/appcat/v4/apis/appcat/v1 \
--output-base=./.work/tmp \
--go-header-file=./pkg/apiserver/hack/boilerplate.txt \
--apimachinery-packages='-k8s.io/apimachinery/pkg/util/intstr,-k8s.io/apimachinery/pkg/api/resource,-k8s.io/apimachinery/pkg/runtime/schema,-k8s.io/apimachinery/pkg/runtime,-k8s.io/apimachinery/pkg/apis/meta/v1,-k8s.io/apimachinery/pkg/apis/meta/v1beta1,-k8s.io/api/core/v1,-k8s.io/api/rbac/v1' \
--proto-import=./.work/kubernetes/vendor/ && \
mv ./.work/tmp/github.com/vshn/appcat/apis/appcat/v1/generated.pb.go ./apis/appcat/v1/ && \
mv ./.work/tmp/github.com/vshn/appcat/v4/apis/appcat/v1/generated.pb.go ./apis/appcat/v1/ && \
rm -rf ./.work/tmp

.PHONY: generate-stackgres-crds
Expand Down
177 changes: 89 additions & 88 deletions apis/appcat/v1/generated.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apis/exoscale/v1/dbaas_exoscale_kafka.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
"github.com/vshn/appcat/apis/v1"
"github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion apis/exoscale/v1/dbaas_exoscale_mysql.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
"github.com/vshn/appcat/apis/v1"
"github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion apis/exoscale/v1/dbaas_exoscale_opensearch.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
v1 "github.com/vshn/appcat/apis/v1"
v1 "github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion apis/exoscale/v1/dbaas_exoscale_postgresql.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
v1 "github.com/vshn/appcat/apis/v1"
v1 "github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion apis/exoscale/v1/dbaas_exoscale_redis.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
v1 "github.com/vshn/appcat/apis/v1"
v1 "github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion apis/exoscale/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/vshn/v1/dbaas_vshn_postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v1

import (
alertmanagerv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1"
v1 "github.com/vshn/appcat/apis/v1"
v1 "github.com/vshn/appcat/v4/apis/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion apis/vshn/v1/dbaas_vshn_redis.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v1

import (
v1 "github.com/vshn/appcat/apis/v1"
v1 "github.com/vshn/appcat/v4/apis/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion apis/vshn/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

"github.com/spf13/cobra"
"github.com/spf13/viper"
appcatv1 "github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/pkg/apiserver/appcat"
vshnpostgres "github.com/vshn/appcat/pkg/apiserver/vshn/postgres"
vshnredis "github.com/vshn/appcat/pkg/apiserver/vshn/redis"
appcatv1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/pkg/apiserver/appcat"
vshnpostgres "github.com/vshn/appcat/v4/pkg/apiserver/vshn/postgres"
vshnredis "github.com/vshn/appcat/v4/pkg/apiserver/vshn/redis"
"sigs.k8s.io/apiserver-runtime/pkg/builder"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"github.com/go-logr/logr"
"github.com/spf13/cobra"
"github.com/vshn/appcat/pkg"
"github.com/vshn/appcat/pkg/controller/postgres"
"github.com/vshn/appcat/v4/pkg"
"github.com/vshn/appcat/v4/pkg/controller/postgres"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
Expand Down
12 changes: 6 additions & 6 deletions cmd/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
pb "github.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1alpha1"
"github.com/go-logr/logr"
"github.com/spf13/cobra"
"github.com/vshn/appcat/pkg"
"github.com/vshn/appcat/pkg/comp-functions/functions/helper"
"github.com/vshn/appcat/pkg/comp-functions/functions/miniodev"
vpf "github.com/vshn/appcat/pkg/comp-functions/functions/vshn-postgres-func"
"github.com/vshn/appcat/pkg/comp-functions/functions/vshnredis"
"github.com/vshn/appcat/pkg/comp-functions/runtime"
"github.com/vshn/appcat/v4/pkg"
"github.com/vshn/appcat/v4/pkg/comp-functions/functions/helper"
"github.com/vshn/appcat/v4/pkg/comp-functions/functions/miniodev"
vpf "github.com/vshn/appcat/v4/pkg/comp-functions/functions/vshn-postgres-func"
"github.com/vshn/appcat/v4/pkg/comp-functions/functions/vshnredis"
"github.com/vshn/appcat/v4/pkg/comp-functions/runtime"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
4 changes: 2 additions & 2 deletions cmd/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/thediveo/enumflag/v2"
"github.com/vshn/appcat/pkg"
"github.com/vshn/appcat/pkg/maintenance"
"github.com/vshn/appcat/v4/pkg"
"github.com/vshn/appcat/v4/pkg/maintenance"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/slareport.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/vshn/appcat/pkg/slareport"
"github.com/vshn/appcat/v4/pkg/slareport"
"sigs.k8s.io/controller-runtime/pkg/log"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/sliexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cmd
import (
"github.com/go-logr/logr"
"github.com/spf13/cobra"
"github.com/vshn/appcat/pkg"
"github.com/vshn/appcat/pkg/sliexporter"
"github.com/vshn/appcat/pkg/sliexporter/probes"
"github.com/vshn/appcat/v4/pkg"
"github.com/vshn/appcat/v4/pkg/sliexporter"
"github.com/vshn/appcat/v4/pkg/sliexporter/probes"
"k8s.io/apimachinery/pkg/runtime"
"os"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/vshn/appcat
module github.com/vshn/appcat/v4

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/vshn/appcat/cmd"
"github.com/vshn/appcat/v4/cmd"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/appcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appcat

import (
crossplane "github.com/crossplane/crossplane/apis/apiextensions/v1"
v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/appcat/appcat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

crossplanev1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
v1 "github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/test/mocks"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/test/mocks"
"k8s.io/apiserver/pkg/registry/rest"

"github.com/golang/mock/gomock"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appcat

import (
"context"
v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/appcat/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package appcat

import (
"context"
v1 "github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/pkg/apiserver"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/pkg/apiserver"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appcat

import (
crossplanev1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/appcat/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package appcat
import (
"context"
crossplanev1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/pkg/apiserver"
"github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/pkg/apiserver"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appcat

import (
crossplanev1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/watch"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/appcat/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package appcat

import (
"context"
v1 "github.com/vshn/appcat/apis/appcat/v1"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/rest"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/vshn/postgres/backup.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package postgres

import (
"github.com/vshn/appcat/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/apis/vshn/v1"
"github.com/vshn/appcat/v4/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/v4/apis/vshn/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apiserver/vshn/postgres/backup_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package postgres

import (
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/test/mocks"
"github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/test/mocks"

vshnv1 "github.com/vshn/appcat/apis/vshn/v1"
vshnv1 "github.com/vshn/appcat/v4/apis/vshn/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/rest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/vshn/postgres/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package postgres

import (
"context"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/v4/apis/appcat/v1"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/vshn/postgres/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package postgres
import (
"context"
"fmt"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/pkg/apiserver"
"github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/pkg/apiserver"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apiserver/vshn/postgres/get_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package postgres

import (
"github.com/vshn/appcat/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/apis/vshn/v1"
"github.com/vshn/appcat/test/mocks"
"github.com/vshn/appcat/v4/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/v4/apis/vshn/v1"
"github.com/vshn/appcat/v4/test/mocks"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"testing"

Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/vshn/postgres/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

v1 "github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/pkg/apiserver"
v1 "github.com/vshn/appcat/v4/apis/appcat/v1"
"github.com/vshn/appcat/v4/pkg/apiserver"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apiserver/vshn/postgres/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package postgres

import (
"fmt"
"github.com/vshn/appcat/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/apis/vshn/v1"
"github.com/vshn/appcat/test/mocks"
"github.com/vshn/appcat/v4/apis/appcat/v1"
vshnv1 "github.com/vshn/appcat/v4/apis/vshn/v1"
"github.com/vshn/appcat/v4/test/mocks"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/vshn/postgres/sgbackups.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package postgres
import (
"context"
"fmt"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/v4/apis/appcat/v1"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/vshn/postgres/sgbackups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/v4/apis/appcat/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/vshn/postgres/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package postgres
import (
"context"
"fmt"
"github.com/vshn/appcat/apis/appcat/v1"
"github.com/vshn/appcat/v4/apis/appcat/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down
Loading