Skip to content

Commit

Permalink
refactor: move api/util to ../shared/
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 13, 2021
1 parent e26c3a9 commit 99bfd15
Show file tree
Hide file tree
Showing 29 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ignore:
- .github
- api/util/containerkiller/container_killer.go
- shared/util/containerkiller/container_killer.go
- api/v1alpha1/generated.pb.go
- api/v1alpha1/zz_generated.deepcopy.go
- config
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
needs: [ test ]
steps:
- uses: actions/checkout@v2
- run: touch api/util/message
- run: touch shared/util/message
- uses: golangci/golangci-lint-action@v2
with:
version: v1.36.0
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download
FROM builder AS controller-builder
COPY .git/ .git/
COPY api/ api/
COPY shared/ shared/
COPY manager/ manager/
RUN go generate ./api/util/version.go
RUN go generate ./shared/util/version.go
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/manager ./manager

FROM gcr.io/distroless/static:nonroot AS controller
Expand All @@ -28,8 +29,9 @@ ENTRYPOINT ["/manager"]
FROM builder AS runner-builder
COPY .git/ .git/
COPY api/ api/
COPY shared/ shared/
COPY runner/ runner/
RUN go generate ./api/util/version.go
RUN go generate ./shared/util/version.go
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/runner ./runner
COPY kill/ kill/
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -o bin/kill ./kill
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build: generate manifests
go build ./...

# Run tests
test: api/util/message
test: shared/util/message
go test -v ./... -coverprofile cover.out

pre-commit: codegen test install lint
Expand Down Expand Up @@ -96,7 +96,7 @@ api/v1alpha1/generated.%: $(shell find api/v1alpha1 -type f -name '*.go' -not -n
mv api/v1alpha1/groupversion_info.go.0 api/v1alpha1/groupversion_info.go
go mod tidy

lint: api/util/message
lint: shared/util/message
go mod tidy
golangci-lint run --fix
kubectl apply --dry-run=client -f docs/examples
Expand Down Expand Up @@ -126,7 +126,7 @@ scan-%:
changelog:
git log --oneline -n10 > changelog

$(GOBIN)/controller-gen: api/util/message
$(GOBIN)/controller-gen: shared/util/message
go install sigs.k8s.io/controller-tools/cmd/[email protected]

version:=2.3.2
Expand All @@ -150,11 +150,11 @@ config/nats/single-server-nats.yml:
config/stan/single-server-stan.yml:
curl -o config/stan/single-server-stan.yml https://raw.githubusercontent.com/nats-io/k8s/v0.7.4/nats-streaming-server/single-server-stan.yml

api/util/message:
touch api/util/message
shared/util/message:
touch shared/util/message

.PHONY: test-examples
test-examples: api/util/message
test-examples: shared/util/message
go test -timeout 20m -v -tags examples -count 1 ./docs/examples

argocli:
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/step_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"time"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
"sigs.k8s.io/yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion manager/controllers/bus/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"k8s.io/client-go/rest"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"

appsv1 "k8s.io/api/apps/v1"
Expand Down
2 changes: 1 addition & 1 deletion manager/controllers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"time"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"

dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion manager/controllers/pipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/argoproj-labs/argo-dataflow/manager/controllers/bus"
"github.com/argoproj-labs/argo-dataflow/shared/containerkiller"
Expand Down
2 changes: 1 addition & 1 deletion manager/controllers/step_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/argoproj-labs/argo-dataflow/shared/containerkiller"
)
Expand Down
2 changes: 1 addition & 1 deletion runner/group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"
"sort"

util2 "github.com/argoproj-labs/argo-dataflow/api/util"
util2 "github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/argoproj-labs/argo-dataflow/runner/util"

Expand Down
2 changes: 1 addition & 1 deletion runner/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"path/filepath"
"syscall"

util2 "github.com/argoproj-labs/argo-dataflow/api/util"
util2 "github.com/argoproj-labs/argo-dataflow/shared/util"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
Expand Down
2 changes: 1 addition & 1 deletion runner/sidecar/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

apiutil "github.com/argoproj-labs/argo-dataflow/api/util"
apiutil "github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/argoproj-labs/argo-dataflow/runner/util"
)
Expand Down
2 changes: 1 addition & 1 deletion shared/containerkiller/container_killer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"k8s.io/client-go/tools/remotecommand"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/argoproj-labs/argo-dataflow/api/util"
"github.com/argoproj-labs/argo-dataflow/shared/util"
dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
)

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.
File renamed without changes.
File renamed without changes.

0 comments on commit 99bfd15

Please sign in to comment.