Skip to content

Commit 60e8ffc

Browse files
committed
feat: reimplement the provider for liqo 1.0
1 parent dad92e2 commit 60e8ffc

File tree

21 files changed

+1685
-1055
lines changed

21 files changed

+1685
-1055
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ jobs:
1717
- name: Setup Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.21'
20+
go-version: '1.24'
21+
22+
- name: Generate version constants
23+
run: go generate ./liqo
2124

2225
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v3.7.0
26+
uses: golangci/golangci-lint-action@v7
2427
with:
2528
only-new-issues: true
26-
version: v1.55.1
29+
version: latest
30+
args: --timeout=900s
2731

2832
gomodtidy:
2933
name: Enforce go.mod tidiness
@@ -40,7 +44,10 @@ jobs:
4044
- name: Setup Go
4145
uses: actions/setup-go@v5
4246
with:
43-
go-version: '1.21'
47+
go-version: '1.24'
48+
49+
- name: Generate version constants
50+
run: go generate ./liqo
4451

4552
- name: Execute go mod tidy and check the outcome
4653
working-directory: ./

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
fetch-depth: 0
2424
- uses: actions/setup-go@v5
2525
with:
26-
go-version: '1.21'
26+
go-version: '1.24'
2727
go-version-file: 'go.mod'
2828
cache: true
29+
- name: Generate version constants
30+
run: go generate ./liqo
2931
- name: Import GPG key
3032
uses: crazy-max/ghaction-import-gpg@v5
3133
id: import_gpg

.golangci.yml

Lines changed: 107 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,141 @@
1-
run:
2-
timeout: 10m
3-
skip-files:
4-
- "zz_generated.*.go"
5-
6-
linters-settings:
7-
exhaustive:
8-
check-generated: false
9-
default-signifies-exhaustive: true
10-
11-
lll:
12-
line-length: 150
13-
gomodguard:
14-
blocked:
15-
modules:
16-
- github.com/go-logr/logr:
17-
recommendations:
18-
- k8s.io/klog/v2
19-
gci:
20-
sections:
21-
- standard # Captures all standard packages if they do not match another section.
22-
- default # Contains all imports that could not be matched to another section type.
23-
- prefix(github.com/liqotech) # Groups all imports with the specified Prefix.
24-
goconst:
25-
min-len: 2
26-
min-occurrences: 2
27-
gocritic:
28-
enabled-tags:
29-
- diagnostic
30-
- experimental
31-
- opinionated
32-
- performance
33-
- style
34-
disabled-checks:
35-
# Conflicts with govet check-shadowing
36-
- sloppyReassign
37-
goimports:
38-
local-prefixes: github.com/liqotech
39-
govet:
40-
check-shadowing: true
41-
misspell:
42-
locale: US
43-
nolintlint:
44-
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
45-
allow-unused: false # report any unused nolint directives
46-
require-explanation: true # require an explanation for nolint directives
47-
require-specific: true # require nolint directives to be specific about which linter is being skipped
48-
dupl:
49-
threshold: 300
50-
1+
version: "2"
512
linters:
52-
disable-all: true
3+
default: none
534
enable:
545
- asciicheck
556
- bodyclose
56-
- depguard
7+
- copyloopvar
578
- dogsled
589
- dupl
5910
- errcheck
6011
- errorlint
6112
- exhaustive
62-
- exportloopref
63-
# - funlen
64-
# - gochecknoglobals
65-
# - gochecknoinits
66-
# - gocognit
67-
- gci
6813
- goconst
6914
- gocritic
7015
- gocyclo
7116
- godot
72-
# - godox
73-
# - goerr113
74-
- gofmt
7517
- goheader
76-
- goimports
7718
- gomodguard
78-
# - gomnd
7919
- goprintffuncname
8020
- gosec
81-
- gosimple
8221
- govet
8322
- ineffassign
8423
- lll
85-
# - maligned
8624
- misspell
8725
- nakedret
88-
# - nestif
8926
- noctx
90-
- nolintlint
91-
# - prealloc
27+
#- nolintlint
9228
- revive
9329
- rowserrcheck
9430
- staticcheck
95-
- stylecheck
96-
# - testpackage
97-
- typecheck
9831
- unconvert
9932
- unparam
10033
- unused
10134
- whitespace
102-
# - wsl
35+
settings:
36+
dupl:
37+
threshold: 300
38+
exhaustive:
39+
default-signifies-exhaustive: true
40+
goconst:
41+
min-len: 2
42+
min-occurrences: 2
43+
gocritic:
44+
disabled-checks:
45+
- sloppyReassign
46+
enabled-tags:
47+
- diagnostic
48+
- experimental
49+
- opinionated
50+
- performance
51+
- style
52+
goheader:
53+
values:
54+
const:
55+
AUTHORS: The Liqo Authors
56+
template: |-
57+
Copyright 2019-{{ YEAR }} {{ AUTHORS }}
10358
104-
issues:
105-
#fix: true
59+
Licensed under the Apache License, Version 2.0 (the "License");
60+
you may not use this file except in compliance with the License.
61+
You may obtain a copy of the License at
62+
63+
http://www.apache.org/licenses/LICENSE-2.0
10664
65+
Unless required by applicable law or agreed to in writing, software
66+
distributed under the License is distributed on an "AS IS" BASIS,
67+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
68+
See the License for the specific language governing permissions and
69+
limitations under the License.
70+
gomodguard:
71+
blocked:
72+
modules:
73+
- github.com/go-logr/logr:
74+
recommendations:
75+
- k8s.io/klog/v2
76+
govet:
77+
enable:
78+
- shadow
79+
- nilness
80+
- nilfunc
81+
lll:
82+
line-length: 150
83+
misspell:
84+
locale: US
85+
nolintlint:
86+
require-explanation: true
87+
require-specific: true
88+
allow-unused: false
89+
exclusions:
90+
generated: lax
91+
rules:
92+
- linters:
93+
- govet
94+
text: declaration of "(err|ctx)" shadows declaration at
95+
- linters:
96+
- gosec
97+
# Disable the check to test that HTTP clients are not using an insecure TLS connection.
98+
# We need it to contact the remote authentication services exposing a self-signed certificate
99+
text: TLS InsecureSkipVerify set true.
100+
- linters:
101+
- errorlint
102+
# Disable the check to test errors type assertion on switches.
103+
text: type switch on error will fail on wrapped errors. Use errors.As to check for specific errors
104+
- linters:
105+
- revive
106+
- whitespace
107+
path: _test\.go
108+
- path: (.+)\.go$
109+
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
110+
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
111+
paths:
112+
- zz_generated.*.go
113+
- pkg/client
114+
- third_party$
115+
- builtin$
116+
- examples$
117+
issues:
107118
max-issues-per-linter: 0
108119
max-same-issues: 0
109-
110-
# Disable the default exclude patterns (as they disable the mandatory comments)
111-
exclude-use-default: false
112-
exclude:
113-
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
114-
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
115-
116-
exclude-rules:
117-
- linters:
118-
- govet
119-
text: 'declaration of "(err|ctx)" shadows declaration at'
120-
- linters:
121-
- gosec
122-
# Disable the check to test that HTTP clients are not using an insecure TLS connection.
123-
# We need it to contact the remote authentication services exposing a self-signed certificate
124-
text: TLS InsecureSkipVerify set true.
125-
- linters:
126-
- errorlint
127-
# Disable the check to test errors type assertion on switches.
128-
text: type switch on error will fail on wrapped errors. Use errors.As to check for specific errors
129-
130-
# Exclude the following linters from running on tests files.
131-
- path: _test\.go
132-
linters:
133-
- whitespace
120+
formatters:
121+
enable:
122+
- gci
123+
- gofmt
124+
- goimports
125+
settings:
126+
gci:
127+
sections:
128+
- standard # Captures all standard packages if they do not match another section.
129+
- default # Contains all imports that could not be matched to another section type.
130+
- prefix(github.com/liqotech/liqo-terraform-provider) # Groups all imports with the specified Prefix.
131+
goimports:
132+
local-prefixes:
133+
- github.com/liqotech/liqo-terraform-provider
134+
exclusions:
135+
generated: lax
136+
paths:
137+
- zz_generated.*.go
138+
- pkg/client
139+
- third_party$
140+
- builtin$
141+
- examples$

0 commit comments

Comments
 (0)