Skip to content

Commit 4a60a15

Browse files
committed
deps: Adapt code
Signed-off-by: Enrique Llorente <[email protected]>
1 parent 3b288a1 commit 4a60a15

27 files changed

+203
-81
lines changed

.golangci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ linters-settings:
55
lines: 100
66
statements: 50
77
gci:
8-
local-prefixes: github.com/nmstate/nmpolicy
8+
prefix: github.com/nmstate/nmpolicy
99
goconst:
1010
min-len: 2
1111
min-occurrences: 3
@@ -32,16 +32,16 @@ linters-settings:
3232
goheader:
3333
template-path: hack/header.tpl
3434
goimports:
35-
local-prefixes: github.com/nmstate/nmpolicy
36-
gomnd:
35+
prefix: github.com/nmstate/nmpolicy
36+
mnd:
3737
# don't include the "operation" and "assign"
3838
checks:
3939
- argument
4040
- case
4141
- condition
4242
- return
4343
govet:
44-
check-shadowing: true
44+
shadow: true
4545
lll:
4646
line-length: 140
4747
maligned:
@@ -61,13 +61,13 @@ issues:
6161
# Exclude some linters from running on tests files.
6262
- path: test/
6363
linters:
64-
- gomnd
64+
- mnd
6565
- dupl
6666
- gocritic
6767
- path: _test.go
6868
linters:
6969
- unparam
70-
- gomnd
70+
- mnd
7171
- dupl
7272
- gocritic
7373

@@ -78,7 +78,7 @@ linters:
7878
- dogsled
7979
- dupl
8080
#- errcheck
81-
- exportloopref
81+
- copyloopvar
8282
- exhaustive
8383
- funlen
8484
#- gochecknoinits
@@ -88,7 +88,7 @@ linters:
8888
- gofmt
8989
- goheader
9090
- goimports
91-
- gomnd
91+
- mnd
9292
- goprintffuncname
9393
- gosec
9494
- gosimple

api/shared/nodenetworkstate_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
Copyright The Kubernetes NMState Authors.
3+
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
118
package shared
219

320
import (

api/shared/nodenetworkstate_util.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Copyright The Kubernetes NMState Authors.
3+
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package shared
19+
120
// custom marshaling/unmarshaling that will allow to populate nmstate state
221
// as play yaml without the need to generate a golang struct following [1]
322
//
@@ -6,8 +25,6 @@
625
//
726
// [1] https://github.com/nmstate/nmstate/blob/base/libnmstate/schemas/operational-state.yaml
827

9-
package shared
10-
1128
import (
1229
yaml "sigs.k8s.io/yaml"
1330
)

api/v1alpha1/groupversion_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
Copyright The Kubernetes NMState Authors.
23
34
45
Licensed under the Apache License, Version 2.0 (the "License");

api/v1alpha1/nodenetworkstate_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
Copyright The Kubernetes NMState Authors.
3+
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
118
package v1alpha1
219

320
import (

api/v1beta1/groupversion_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
Copyright The Kubernetes NMState Authors.
23
34
45
Licensed under the Apache License, Version 2.0 (the "License");

api/v1beta1/nmstate_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
Copyright The Kubernetes NMState Authors.
23
34
45
Licensed under the Apache License, Version 2.0 (the "License");

api/v1beta1/nodenetworkconfigurationpolicy_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
Copyright The Kubernetes NMState Authors.
3+
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
118
package v1beta1
219

320
import (

api/v1beta1/nodenetworkstate_types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
Copyright The Kubernetes NMState Authors.
3+
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
118
package v1beta1
219

320
import (

automation/check-patch.setup.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ mkdir -p $tmp_dir
1010

1111
if gimme --help > /dev/null 2>&1; then
1212

13-
go_mod_version=$(grep '^go' go.mod |sed 's/go //')
14-
full_version=$(curl -s https://go.dev/dl/?mode=json |jq -r .[].version |grep "$go_mod_version")
15-
export GIMME_GO_VERSION=$(echo $full_version |sed 's/go//')
13+
version=$(grep '^go' go.mod |sed 's/go //')
14+
if [ "$(echo $version | grep "[0-9]*\.[0-9]*\.[0-9]*$")" == "" ] ; then
15+
version=$(curl -s https://go.dev/dl/?mode=json |jq -r .[].version |grep "$go_mod_version")
16+
fi
17+
export GIMME_GO_VERSION=$(echo $version |sed 's/go//')
1618
echo "Installing go $GIMME_GO_VERSION with gimme"
1719
eval "$(gimme)"
1820
else

0 commit comments

Comments
 (0)