diff --git a/.travis.yml b/.travis.yml index bc047c6a..09796c73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,14 +8,14 @@ go_import_path: github.com/kubeflow/mxnet-operator install: # get coveralls.io support - go get github.com/mattn/goveralls - - go get -u github.com/alecthomas/gometalinter - - gometalinter --install + # Install golangci-lint + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.7 script: - hack/verify-codegen.sh - go build -o mxnet-operator.v1beta1 github.com/kubeflow/mxnet-operator/cmd/mxnet-operator.v1beta1 - go build -o mxnet-operator.v1 github.com/kubeflow/mxnet-operator/cmd/mxnet-operator.v1 - - gometalinter --config=linter_config.json --vendor ./... + - golangci-lint run --config=linter_config.yaml ./... # We customize the build step because by default # Travis runs go test -v ./... which will include the vendor # directory. diff --git a/linter_config.json b/linter_config.json deleted file mode 100644 index 699be27e..00000000 --- a/linter_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "Vendor": true, - "DisableAll": true, - "Enable": [ - "vet", - "safesql", - "errcheck", - "goconst", - "goimports", - "varcheck", - "gosec", - "gotype", - "staticcheck", - "lll", - "unconvert", - "misspell", - "unconvert" - ], - "Aggregate": true, - "WarnUnmatchedNolint": true, - "LineLength": 240, - "Exclude": [ - "redundant return statement", - "comment or be unexported", - "comment on exported", - "pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go", - "pkg/apis/mxnet/v1beta1/zz_generated.defaults.go" - ], - "Deadline": "300s", - "Skip": ["pkg/client"] -} diff --git a/linter_config.yaml b/linter_config.yaml new file mode 100644 index 00000000..221ceec7 --- /dev/null +++ b/linter_config.yaml @@ -0,0 +1,50 @@ +# This file contains golangci-lint configurations + +run: + # default concurrency is a available CPU number + concurrency: 4 + + # timeout for analysis, e.g. 30s, 5m, default is 1m + timeout: 300s + + # exit code when at least one issue was found, default is 1 + issues-exit-code: 1 + + # include test files or not, default is true + tests: true + + # which dirs to skip: issues from them won't be reported; +# skip-dirs: +# - pkg/client +# - pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go +# - pkg/apis/mxnet/v1beta1/zz_generated.defaults.go + + # default is true. Enables skipping of directories: + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + skip-dirs-use-default: true + +linters: + # please, do not use `enable-all`: it's deprecated and will be removed soon. + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint + disable-all: true + enable: + - bodyclose + - deadcode + - errcheck + - misspell + - lll + - typecheck + - unconvert + - unused + - varcheck + - govet + - staticcheck +linters-settings: + lll: + # max line length, lines longer will be reported. Default is 120. + line-length: 240 + +# +# "redundant return statement", +# "comment or be unexported", +# "comment on exported", diff --git a/pkg/apis/mxnet/v1/zz_generated.deepcopy.go b/pkg/apis/mxnet/v1/zz_generated.deepcopy.go index 5a0af391..6c2f904a 100644 --- a/pkg/apis/mxnet/v1/zz_generated.deepcopy.go +++ b/pkg/apis/mxnet/v1/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ // +build !ignore_autogenerated -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/mxnet/v1/zz_generated.defaults.go b/pkg/apis/mxnet/v1/zz_generated.defaults.go index 1bd8ca50..ea67e381 100644 --- a/pkg/apis/mxnet/v1/zz_generated.defaults.go +++ b/pkg/apis/mxnet/v1/zz_generated.defaults.go @@ -1,6 +1,6 @@ // +build !ignore_autogenerated -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go b/pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go index 54acb97c..22157538 100644 --- a/pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/mxnet/v1beta1/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ // +build !ignore_autogenerated -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/apis/mxnet/v1beta1/zz_generated.defaults.go b/pkg/apis/mxnet/v1beta1/zz_generated.defaults.go index a1cc0c5b..35137730 100644 --- a/pkg/apis/mxnet/v1beta1/zz_generated.defaults.go +++ b/pkg/apis/mxnet/v1beta1/zz_generated.defaults.go @@ -1,6 +1,6 @@ // +build !ignore_autogenerated -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 25f5be2e..d1461053 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go index a3117943..a228cadd 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/pkg/client/clientset/versioned/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index fe3450e1..be497831 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index 8c0be5ac..280810d6 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 2938fb81..2d4603bc 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index d0f75289..5a9f51a0 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index c08bb5d5..f61dde91 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/doc.go b/pkg/client/clientset/versioned/typed/mxnet/v1/doc.go index 5c8101df..3a37e2c5 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/doc.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/doc.go index ce2fa8a9..e664a4c3 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxjob.go b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxjob.go index 55b76cb4..5a321153 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxjob.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxnet_client.go b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxnet_client.go index 337ecdfa..be083c58 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxnet_client.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/fake/fake_mxnet_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/mxnet/v1/generated_expansion.go index e1fc0a68..4f3d5561 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/generated_expansion.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/mxjob.go b/pkg/client/clientset/versioned/typed/mxnet/v1/mxjob.go index 4149c61a..6668ddb0 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/mxjob.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1/mxnet_client.go b/pkg/client/clientset/versioned/typed/mxnet/v1/mxnet_client.go index 8e47590a..6bb44c1f 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1/mxnet_client.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1/mxnet_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/doc.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/doc.go index 0ceb8cf4..ff5ab3ff 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/doc.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/doc.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/doc.go index ce2fa8a9..e664a4c3 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/doc.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxjob.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxjob.go index 8f88af26..c68a65a5 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxjob.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxnet_client.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxnet_client.go index f7522ce7..f7217840 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxnet_client.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/fake/fake_mxnet_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/generated_expansion.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/generated_expansion.go index b40d16e3..64d786c8 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/generated_expansion.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxjob.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxjob.go index 5ea6151f..45b4441f 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxjob.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxnet_client.go b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxnet_client.go index aaa914c2..9c33d79d 100644 --- a/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxnet_client.go +++ b/pkg/client/clientset/versioned/typed/mxnet/v1beta1/mxnet_client.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 66c96151..c55c0c07 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index cace5438..26b8d8ff 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index dbb9c2e5..130ace24 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/mxnet/interface.go b/pkg/client/informers/externalversions/mxnet/interface.go index 7a60fa9d..ac463324 100644 --- a/pkg/client/informers/externalversions/mxnet/interface.go +++ b/pkg/client/informers/externalversions/mxnet/interface.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/mxnet/v1/interface.go b/pkg/client/informers/externalversions/mxnet/v1/interface.go index f4dd4c76..f8074c94 100644 --- a/pkg/client/informers/externalversions/mxnet/v1/interface.go +++ b/pkg/client/informers/externalversions/mxnet/v1/interface.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/mxnet/v1/mxjob.go b/pkg/client/informers/externalversions/mxnet/v1/mxjob.go index c394a811..210a442d 100644 --- a/pkg/client/informers/externalversions/mxnet/v1/mxjob.go +++ b/pkg/client/informers/externalversions/mxnet/v1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/mxnet/v1beta1/interface.go b/pkg/client/informers/externalversions/mxnet/v1beta1/interface.go index 4eb47cf7..42ecfb7a 100644 --- a/pkg/client/informers/externalversions/mxnet/v1beta1/interface.go +++ b/pkg/client/informers/externalversions/mxnet/v1beta1/interface.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/mxnet/v1beta1/mxjob.go b/pkg/client/informers/externalversions/mxnet/v1beta1/mxjob.go index fab65f40..1dfbd268 100644 --- a/pkg/client/informers/externalversions/mxnet/v1beta1/mxjob.go +++ b/pkg/client/informers/externalversions/mxnet/v1beta1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/mxnet/v1/expansion_generated.go b/pkg/client/listers/mxnet/v1/expansion_generated.go index eb7a4b9a..27790022 100644 --- a/pkg/client/listers/mxnet/v1/expansion_generated.go +++ b/pkg/client/listers/mxnet/v1/expansion_generated.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/mxnet/v1/mxjob.go b/pkg/client/listers/mxnet/v1/mxjob.go index 8397f376..7c88d842 100644 --- a/pkg/client/listers/mxnet/v1/mxjob.go +++ b/pkg/client/listers/mxnet/v1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/mxnet/v1beta1/expansion_generated.go b/pkg/client/listers/mxnet/v1beta1/expansion_generated.go index 14ef873b..8c5fa3be 100644 --- a/pkg/client/listers/mxnet/v1beta1/expansion_generated.go +++ b/pkg/client/listers/mxnet/v1beta1/expansion_generated.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/mxnet/v1beta1/mxjob.go b/pkg/client/listers/mxnet/v1beta1/mxjob.go index abab10c9..a2948498 100644 --- a/pkg/client/listers/mxnet/v1beta1/mxjob.go +++ b/pkg/client/listers/mxnet/v1beta1/mxjob.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Kubeflow Authors +// Copyright 2020 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/controller.v1/mxnet/job_test.go b/pkg/controller.v1/mxnet/job_test.go index bbc2ee6f..912e2507 100644 --- a/pkg/controller.v1/mxnet/job_test.go +++ b/pkg/controller.v1/mxnet/job_test.go @@ -66,7 +66,9 @@ func TestAddMXJob(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) @@ -135,7 +137,9 @@ func TestCopyLabelsAndAnnotation(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) diff --git a/pkg/controller.v1/mxnet/pod_test.go b/pkg/controller.v1/mxnet/pod_test.go index d596ae9d..9df0c575 100644 --- a/pkg/controller.v1/mxnet/pod_test.go +++ b/pkg/controller.v1/mxnet/pod_test.go @@ -63,7 +63,9 @@ func TestAddPod(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) @@ -187,7 +189,9 @@ func TestExitCode(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) diff --git a/pkg/controller.v1/mxnet/service_test.go b/pkg/controller.v1/mxnet/service_test.go index dfe0345d..2b955c9a 100644 --- a/pkg/controller.v1/mxnet/service_test.go +++ b/pkg/controller.v1/mxnet/service_test.go @@ -63,7 +63,9 @@ func TestAddService(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) diff --git a/pkg/controller.v1beta1/mxnet/job_test.go b/pkg/controller.v1beta1/mxnet/job_test.go index bf71813f..da6933c3 100644 --- a/pkg/controller.v1beta1/mxnet/job_test.go +++ b/pkg/controller.v1beta1/mxnet/job_test.go @@ -65,7 +65,9 @@ func TestAddMXJob(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) @@ -134,7 +136,9 @@ func TestCopyLabelsAndAnnotation(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) diff --git a/pkg/controller.v1beta1/mxnet/pod_test.go b/pkg/controller.v1beta1/mxnet/pod_test.go index 31faa9fc..981b2b7d 100644 --- a/pkg/controller.v1beta1/mxnet/pod_test.go +++ b/pkg/controller.v1beta1/mxnet/pod_test.go @@ -63,7 +63,9 @@ func TestAddPod(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) @@ -187,7 +189,9 @@ func TestExitCode(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh) diff --git a/pkg/controller.v1beta1/mxnet/service_test.go b/pkg/controller.v1beta1/mxnet/service_test.go index a8539855..ee07908c 100644 --- a/pkg/controller.v1beta1/mxnet/service_test.go +++ b/pkg/controller.v1beta1/mxnet/service_test.go @@ -63,7 +63,9 @@ func TestAddService(t *testing.T) { stopCh := make(chan struct{}) run := func(<-chan struct{}) { - ctr.Run(testutil.ThreadCount, stopCh) + if err := ctr.Run(testutil.ThreadCount, stopCh); err != nil { + t.Errorf("Failed to run MXNet Controller!") + } } go run(stopCh)