Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: roi.kramer <roi.kramer@codefresh.io>
  • Loading branch information
roi-codefresh committed Feb 13, 2021
2 parents 1fa9a3c + a50ddb2 commit 2120f13
Show file tree
Hide file tree
Showing 192 changed files with 1,581 additions and 1,446 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Pre-pull images
env:
GOPATH: /home/runner/go
run: make pull-build-images test-images &
run: make test-images &
- name: Create Kubeconfig
run: |
mkdir -p ~/.kube
Expand Down
15 changes: 14 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://github.com/golangci/golangci/wiki/Configuration
# https://golangci-lint.run/usage/quick-start/
run:
skip-dirs:
- pkg/client
Expand All @@ -14,7 +14,20 @@ run:
- functional
linters:
enable:
- deadcode
- errcheck
- goimports
- gci
- gofumpt
- gosimple
- govet
- misspell
- staticcheck
- structcheck
- typecheck
- unparam
- unused
- varcheck
linters-settings:
goimports:
local-prefixes: github.com/argoproj/argo-workflows/
25 changes: 11 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ define protoc
-I /usr/local/include \
-I $(CURDIR) \
-I $(CURDIR)/vendor \
-I ${GOPATH}/src \
-I ${GOPATH}/pkg/mod/github.com/gogo/protobuf@v1.3.1/gogoproto \
-I ${GOPATH}/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/third_party/googleapis \
--gogofast_out=plugins=grpc:${GOPATH}/src \
--grpc-gateway_out=logtostderr=true:${GOPATH}/src \
-I $(GOPATH)/src \
-I $(GOPATH)/pkg/mod/github.com/gogo/protobuf@v1.3.1/gogoproto \
-I $(GOPATH)/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/third_party/googleapis \
--gogofast_out=plugins=grpc:$(GOPATH)/src \
--grpc-gateway_out=logtostderr=true:$(GOPATH)/src \
--swagger_out=logtostderr=true,fqn_for_swagger_name=true:. \
$(1)
perl -i -pe 's|argoproj/argo-workflows/|argoproj/argo-workflows/v3/|g' `echo "$(1)" | sed 's/proto/pb.go/g'`
Expand Down Expand Up @@ -259,6 +259,7 @@ codegen: \
go generate ./persist/sqldb ./pkg/apiclient/workflow ./server/auth ./server/auth/sso ./workflow/executor
rm -Rf vendor
go mod tidy
./hack/check-env-doc.sh

$(GOPATH)/bin/mockery:
./hack/recurl.sh dist/mockery.tar.gz https://github.com/vektra/mockery/releases/download/v1.1.1/mockery_1.1.1_$(shell uname -s)_$(shell uname -m).tar.gz
Expand Down Expand Up @@ -298,7 +299,7 @@ $(GOPATH)/bin/goimports:
pkg/apis/workflow/v1alpha1/generated.proto: $(GOPATH)/bin/go-to-protobuf $(PROTO_BINARIES) $(TYPES)
go mod vendor
[ -e v3 ] || ln -s . v3
${GOPATH}/bin/go-to-protobuf \
$(GOPATH)/bin/go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
--packages=github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--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/api/core/v1,k8s.io/api/policy/v1beta1 \
Expand Down Expand Up @@ -359,7 +360,7 @@ manifests/install.yaml: $(CRDS) dist/kustomize
# lint/test/etc

$(GOPATH)/bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.33.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.36.0

.PHONY: lint
lint: server/static/files.go $(GOPATH)/bin/golangci-lint
Expand All @@ -383,7 +384,7 @@ install: $(MANIFESTS) $(E2E_MANIFESTS) dist/kustomize
kubectl get ns $(KUBE_NAMESPACE) || kubectl create ns $(KUBE_NAMESPACE)
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
@echo "installing PROFILE=$(PROFILE) VERSION=$(VERSION), E2E_EXECUTOR=$(E2E_EXECUTOR)"
dist/kustomize build --load_restrictor=none test/e2e/manifests/$(PROFILE) | sed 's/image: argoproj/image: $(IMAGE_NAMESPACE)/' | sed 's/:latest/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply -f -
dist/kustomize build --load_restrictor=none test/e2e/manifests/$(PROFILE) | sed 's/argoproj\//$(IMAGE_NAMESPACE)\//' | sed 's/:latest/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply -f -
kubectl -n $(KUBE_NAMESPACE) apply -f test/stress/massive-workflow.yaml
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy workflow-controller
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy argo-server
Expand All @@ -394,10 +395,6 @@ ifeq ($(RUN_MODE),kubernetes)
kubectl -n $(KUBE_NAMESPACE) scale deploy/argo-server --replicas 1
endif

.PHONY: pull-build-images
pull-build-images:
./hack/pull-build-images.sh

.PHONY: argosay
argosay: test/e2e/images/argosay/v2/argosay
cd test/e2e/images/argosay/v2 && docker build . -t argoproj/argosay:v2
Expand Down Expand Up @@ -502,7 +499,7 @@ clean:

pkg/apis/workflow/v1alpha1/openapi_generated.go: $(GOPATH)/bin/openapi-gen $(TYPES)
[ -e v3 ] || ln -s . v3
openapi-gen \
$(GOPATH)/bin/openapi-gen \
--go-header-file ./hack/custom-boilerplate.go.txt \
--input-dirs github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--output-package github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
Expand All @@ -513,7 +510,7 @@ pkg/apis/workflow/v1alpha1/openapi_generated.go: $(GOPATH)/bin/openapi-gen $(TYP
# generates many other files (listers, informers, client etc).
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go: $(TYPES)
[ -e v3 ] || ln -s . v3
bash ${GOPATH}/pkg/mod/k8s.io/code-generator@v0.19.6/generate-groups.sh \
bash $(GOPATH)/pkg/mod/k8s.io/code-generator@v0.19.6/generate-groups.sh \
"deepcopy,client,informer,lister" \
github.com/argoproj/argo-workflows/v3/pkg/client github.com/argoproj/argo-workflows/v3/pkg/apis \
workflow:v1alpha1 \
Expand Down
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Currently, the following organizations are **officially** using Argo Workflows:
1. [Intuit](https://www.intuit.com/)
1. [InVision](https://www.invisionapp.com/)
1. [İşbank](https://www.isbank.com.tr/en)
1. [Jungle](https://www.jungle.ai/)
1. [Karius](https://www.kariusdx.com/)
1. [Kasa](https://www.kasa.co.kr/)
1. [KintoHub](https://www.kintohub.com/)
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/archive/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func NewDeleteCommand() *cobra.Command {
var command = &cobra.Command{
command := &cobra.Command{
Use: "delete UID...",
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
Expand Down
6 changes: 2 additions & 4 deletions cmd/argo/commands/archive/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import (
)

func NewGetCommand() *cobra.Command {
var (
output string
)
var command = &cobra.Command{
var output string
command := &cobra.Command{
Use: "get UID",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/archive/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewListCommand() *cobra.Command {
output string
chunkSize int64
)
var command = &cobra.Command{
command := &cobra.Command{
Use: "list",
Run: func(cmd *cobra.Command, args []string) {
ctx, apiClient := client.NewAPIClient()
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/archive/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func NewArchiveCommand() *cobra.Command {
var command = &cobra.Command{
command := &cobra.Command{
Use: "archive",
Run: func(cmd *cobra.Command, args []string) {
cmd.HelpFunc()(cmd, args)
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/auth/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func NewAuthCommand() *cobra.Command {
var command = &cobra.Command{
command := &cobra.Command{
Use: "auth",
Run: func(cmd *cobra.Command, args []string) {
cmd.HelpFunc()(cmd, args)
Expand Down
6 changes: 4 additions & 2 deletions cmd/argo/commands/client/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"github.com/argoproj/argo-workflows/v3/util/kubeconfig"
)

var argoServerOpts = apiclient.ArgoServerOpts{}
var instanceID string
var (
argoServerOpts = apiclient.ArgoServerOpts{}
instanceID string
)

var overrides = clientcmd.ConfigOverrides{}

Expand Down
1 change: 0 additions & 1 deletion cmd/argo/commands/client/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ func TestGetAuthString(t *testing.T) {
_ = os.Setenv("ARGO_TOKEN", "my-token")
defer func() { _ = os.Unsetenv("ARGO_TOKEN") }()
assert.Equal(t, "my-token", GetAuthString())

}

func TestNamespace(t *testing.T) {
Expand Down
6 changes: 2 additions & 4 deletions cmd/argo/commands/clustertemplate/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ type cliCreateOpts struct {
}

func NewCreateCommand() *cobra.Command {
var (
cliCreateOpts cliCreateOpts
)
var command = &cobra.Command{
var cliCreateOpts cliCreateOpts
command := &cobra.Command{
Use: "create FILE1 FILE2...",
Short: "create a cluster workflow template",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
1 change: 0 additions & 1 deletion cmd/argo/commands/clustertemplate/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
`

func TestUnmarshalCWFT(t *testing.T) {

clusterwfts, err := unmarshalClusterWorkflowTemplates([]byte(cwfts), false)
if assert.NoError(t, err) {
assert.Equal(t, 2, len(clusterwfts))
Expand Down
9 changes: 3 additions & 6 deletions cmd/argo/commands/clustertemplate/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ package clustertemplate
import (
"fmt"

"github.com/spf13/cobra"

"github.com/argoproj/pkg/errors"
"github.com/spf13/cobra"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
"github.com/argoproj/argo-workflows/v3/pkg/apiclient/clusterworkflowtemplate"
)

// NewDeleteCommand returns a new instance of an `argo delete` command
func NewDeleteCommand() *cobra.Command {
var (
all bool
)
var all bool

var command = &cobra.Command{
command := &cobra.Command{
Use: "delete WORKFLOW_TEMPLATE",
Short: "delete a cluster workflow template",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
9 changes: 3 additions & 6 deletions cmd/argo/commands/clustertemplate/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ import (
"fmt"
"log"

"github.com/argoproj/pkg/humanize"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"

"github.com/argoproj/pkg/humanize"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
clusterworkflowtmplpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/clusterworkflowtemplate"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)

func NewGetCommand() *cobra.Command {
var (
output string
)
var output string

var command = &cobra.Command{
command := &cobra.Command{
Use: "get CLUSTER WORKFLOW_TEMPLATE...",
Short: "display details about a cluster workflow template",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/argo/commands/clustertemplate/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ func NewLintCommand() *cobra.Command {
strict bool
format string
)
var command = &cobra.Command{

command := &cobra.Command{
Use: "lint FILE...",
Short: "validate files or directories of cluster workflow template manifests",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
7 changes: 2 additions & 5 deletions cmd/argo/commands/clustertemplate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ type listFlags struct {
}

func NewListCommand() *cobra.Command {
var (
listArgs listFlags
)
var command = &cobra.Command{
var listArgs listFlags
command := &cobra.Command{
Use: "list",
Short: "list cluster workflow templates",
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -42,7 +40,6 @@ func NewListCommand() *cobra.Command {
default:
log.Fatalf("Unknown output mode: %s", listArgs.output)
}

},
}
command.Flags().StringVarP(&listArgs.output, "output", "o", "", "Output format. One of: wide|name")
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/clustertemplate/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func NewClusterTemplateCommand() *cobra.Command {
var command = &cobra.Command{
command := &cobra.Command{
Use: "cluster-template",
Aliases: []string{"cwftmpl", "cwft"},
Short: "manipulate cluster workflow templates",
Expand Down
3 changes: 1 addition & 2 deletions cmd/argo/commands/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"strconv"
"strings"

"github.com/spf13/cobra"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ __argo_custom_func() {
)

func NewCompletionCommand() *cobra.Command {
var command = &cobra.Command{
command := &cobra.Command{
Use: "completion SHELL",
Short: "output shell completion code for the specified shell (bash or zsh)",
Long: `Write bash or zsh shell completion code to standard output.
Expand Down
4 changes: 1 addition & 3 deletions cmd/argo/commands/cron/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
cronworkflowpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/cronworkflow"

wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
"github.com/argoproj/argo-workflows/v3/workflow/common"
"github.com/argoproj/argo-workflows/v3/workflow/util"
Expand All @@ -27,7 +26,7 @@ func NewCreateCommand() *cobra.Command {
cliCreateOpts cliCreateOpts
submitOpts wfv1.SubmitOpts
)
var command = &cobra.Command{
command := &cobra.Command{
Use: "create FILE1 FILE2...",
Short: "create a cron workflow",
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -48,7 +47,6 @@ func NewCreateCommand() *cobra.Command {
}

func CreateCronWorkflows(filePaths []string, cliOpts *cliCreateOpts, submitOpts *wfv1.SubmitOpts) {

ctx, apiClient := client.NewAPIClient()
serviceClient := apiClient.NewCronWorkflowServiceClient()

Expand Down
6 changes: 2 additions & 4 deletions cmd/argo/commands/cron/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (

// NewDeleteCommand returns a new instance of an `argo delete` command
func NewDeleteCommand() *cobra.Command {
var (
all bool
)
var all bool

var command = &cobra.Command{
command := &cobra.Command{
Use: "delete [CRON_WORKFLOW... | --all]",
Short: "delete a cron workflow",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
6 changes: 2 additions & 4 deletions cmd/argo/commands/cron/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ import (
)

func NewGetCommand() *cobra.Command {
var (
output string
)
var output string

var command = &cobra.Command{
command := &cobra.Command{
Use: "get CRON_WORKFLOW...",
Short: "display details about a cron workflow",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/argo/commands/cron/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ func NewLintCommand() *cobra.Command {
strict bool
format string
)
var command = &cobra.Command{

command := &cobra.Command{
Use: "lint FILE...",
Short: "validate files or directories of cron workflow manifests",
Run: func(cmd *cobra.Command, args []string) {
Expand Down
Loading

0 comments on commit 2120f13

Please sign in to comment.