diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ece7a3e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,35 @@ +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: {go-version: '=1.19.8'} + + - name: Decide what we're going to call this + run: | + TAG_SPECIFIC=${{ github.ref_name }} + # if we're building from a branch (i.e., not a tag) then add + # the short sha so we can have more than one build per branch + if [[ ${{ github.ref }} != refs/tags/* ]]; then + TAG_SPECIFIC=${TAG_SPECIFIC}-$(git rev-parse --short HEAD) + fi + echo $TAG_SPECIFIC + echo "TAG_SPECIFIC=$TAG_SPECIFIC" >> $GITHUB_ENV + + - name: Make + run: | + make SUFFIX=${TAG_SPECIFIC} check build + + - name: Create a new pre-release + if: startsWith(github.ref, 'refs/tags/') + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + files: | + epicctl + scripts/scan-logs diff --git a/Makefile b/Makefile index 9295079..76afb5e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ run: ## Run the service using "go run". Use the ARGS env var to pass params into .PHONY: build build: check ## Build the executable - CGO_ENABLED=0 go build -ldflags "-X gitlab.com/acnodal/epic/epicctl/cmd.version=${SUFFIX}" -o epicctl . + CGO_ENABLED=0 go build -ldflags "-X epic-gateway.org/epicctl/cmd.version=${SUFFIX}" -o epicctl . .PHONY: install install: check ## Install the exe to the go bin directory diff --git a/cmd/create-ad-hoc-endpoint.go b/cmd/create-ad-hoc-endpoint.go index 6cfc2df..6501ba2 100644 --- a/cmd/create-ad-hoc-endpoint.go +++ b/cmd/create-ad-hoc-endpoint.go @@ -14,7 +14,7 @@ import ( "k8s.io/utils/pointer" crclient "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) var ( diff --git a/cmd/create-ad-hoc-gateway.go b/cmd/create-ad-hoc-gateway.go index fc0b9fd..ff24cb7 100644 --- a/cmd/create-ad-hoc-gateway.go +++ b/cmd/create-ad-hoc-gateway.go @@ -11,7 +11,7 @@ import ( crclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/gateway-api/apis/v1alpha2" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { @@ -113,7 +113,7 @@ func createAdHocGateway(ctx context.Context, cl crclient.Client, account string, }, }, Spec: epicv1.GWRouteSpec{ - HTTP: v1alpha2.HTTPRouteSpec{ + HTTP: &v1alpha2.HTTPRouteSpec{ CommonRouteSpec: v1alpha2.CommonRouteSpec{ ParentRefs: []v1alpha2.ParentReference{{ Name: v1alpha2.ObjectName(name), // Link the Route to the Proxy diff --git a/cmd/create-user-namespace.go b/cmd/create-user-namespace.go index 637e4c4..c5f19e8 100644 --- a/cmd/create-user-namespace.go +++ b/cmd/create-user-namespace.go @@ -8,8 +8,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "gitlab.com/acnodal/epic/epicctl/internal/versioned" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + "epic-gateway.org/epicctl/internal/versioned" + + epicv1 "epic-gateway.org/resource-model/api/v1" ) const ( diff --git a/cmd/create-user.go b/cmd/create-user.go index af72351..f4c0297 100644 --- a/cmd/create-user.go +++ b/cmd/create-user.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { diff --git a/cmd/delete-user.go b/cmd/delete-user.go index 194c9f1..67d1cb6 100644 --- a/cmd/delete-user.go +++ b/cmd/delete-user.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { diff --git a/cmd/describe-ns.go b/cmd/describe-ns.go index 5025728..896e2bf 100644 --- a/cmd/describe-ns.go +++ b/cmd/describe-ns.go @@ -13,7 +13,7 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { diff --git a/cmd/get-ns.go b/cmd/get-ns.go index f3f7b2b..9e8160f 100644 --- a/cmd/get-ns.go +++ b/cmd/get-ns.go @@ -14,7 +14,7 @@ import ( "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { diff --git a/cmd/get-user.go b/cmd/get-user.go index b48851d..2f0e5e2 100644 --- a/cmd/get-user.go +++ b/cmd/get-user.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) func init() { diff --git a/cmd/root.go b/cmd/root.go index cd64af8..6aaa62f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -18,7 +18,7 @@ import ( "k8s.io/client-go/util/homedir" "sigs.k8s.io/controller-runtime/pkg/client" - epicv1 "gitlab.com/acnodal/epic/resource-model/api/v1" + epicv1 "epic-gateway.org/resource-model/api/v1" ) var ( diff --git a/go.mod b/go.mod index 57d4528..55790e0 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ -module gitlab.com/acnodal/epic/epicctl +module epic-gateway.org/epicctl go 1.18 require ( + epic-gateway.org/resource-model v0.55.6 github.com/olekukonko/tablewriter v0.0.5 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.8.1 - gitlab.com/acnodal/epic/resource-model v0.45.3 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 k8s.io/api v0.24.2 @@ -15,6 +15,7 @@ require ( k8s.io/kubectl v0.24.2 k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e sigs.k8s.io/controller-runtime v0.12.3 + sigs.k8s.io/gateway-api v0.5.1 ) require ( @@ -90,7 +91,6 @@ require ( k8s.io/component-base v0.24.2 // indirect k8s.io/klog/v2 v2.60.1 // indirect k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect - sigs.k8s.io/gateway-api v0.5.0-rc1 // indirect sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/go.sum b/go.sum index 63dd1ed..2fe5e71 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +epic-gateway.org/resource-model v0.55.6 h1:VZiw6+Qsf3wltwLXhedsfY6Hrc8y8IPtXSyuK0V3XOQ= +epic-gateway.org/resource-model v0.55.6/go.mod h1:/FCQZJhT+gwXr/fHaucj5YK6qqzEcXgFAc9/XdfP6Qw= github.com/3scale-ops/marin3r v0.9.1 h1:hmS6e4nDpOU1uoZAgpYfJrmzk0whimAT9/uMfH30xfY= github.com/3scale-ops/marin3r v0.9.1/go.mod h1:Ewn8PYB5QGuWEe9b9usdhAsJWmGApUz4VI4L/pXTr40= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -675,8 +677,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -gitlab.com/acnodal/epic/resource-model v0.45.3 h1:kLiuavEUV92wn/iIvr+oXzLFX9ssyrKGsG/DvapUyaY= -gitlab.com/acnodal/epic/resource-model v0.45.3/go.mod h1:eYKVRAschy+mLQzDaQQcYzh/QPme9662JcKu8xJ8lgY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -1281,8 +1281,8 @@ sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gE sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/gateway-api v0.5.0-rc1 h1:r5+fm/ErAJp9fyKMpra5PDUPpOWDbNF5uQuaHrCScOM= -sigs.k8s.io/gateway-api v0.5.0-rc1/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA= +sigs.k8s.io/gateway-api v0.5.1 h1:EqzgOKhChzyve9rmeXXbceBYB6xiM50vDfq0kK5qpdw= +sigs.k8s.io/gateway-api v0.5.1/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= diff --git a/main.go b/main.go index a454635..c21b0c5 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "gitlab.com/acnodal/epic/epicctl/cmd" +import "epic-gateway.org/epicctl/cmd" func main() { cmd.Execute()