Skip to content

Commit 4ed6629

Browse files
authored
Allow configuring NTP pools and servers for LBMs (#411)
* Allow configuring NTP pools and servers for LBMs * Support new config in chart * Format and improve linter settings * go mod tidy * Remove chronyd depencency in favor of restart It seems desirable to start chrony as soon as possible even if it doesn't have its final config yet. If the clock is off by too much, chrony should perform a step instead of slewing the clock. It's better to do this quickly after boot before time-sensitive processes might notice. * Replace deprecated `initstepslew` directive * Comment on not using cloud-init's NTP module * earthly +generate
1 parent 19a519f commit 4ed6629

14 files changed

+542
-306
lines changed

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ out
1414
# Output of the go coverage tool, specifically when used with LiteIDE
1515
*.out
1616

17-
# Kubernetes Generated files - skip generated files, except for vendored files
18-
19-
!vendor/**/zz_generated.*
17+
# Earthly
18+
.tmp-earthly-out
2019

2120
# editor and IDE paraphernalia
2221
.idea

.golangci.yml

+55-61
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,21 @@ linters-settings:
66
statements: 50
77
gocritic:
88
enabled-tags:
9-
- diagnostic
10-
- experimental
11-
- opinionated
12-
- performance
13-
- style
9+
- diagnostic
10+
- experimental
11+
- opinionated
12+
- performance
13+
- style
1414
disabled-checks:
15-
- dupImport # https://github.com/go-critic/go-critic/issues/845
16-
- ifElseChain
17-
- octalLiteral
18-
- whyNoLint
19-
- wrapperFunc
20-
- hugeParam
15+
- dupImport # https://github.com/go-critic/go-critic/issues/845
16+
- ifElseChain
17+
- octalLiteral
18+
- whyNoLint
19+
- wrapperFunc
20+
- hugeParam
2121

2222
gocyclo:
23-
min-complexity:
24-
30 # decrease this
25-
# gci:
26-
# local-prefixes: insert your package name here
27-
# goimports:
28-
# local-prefixes: insert your package name here
29-
#revive:
30-
#rules:
31-
#- name: var-naming
32-
#severity: warning
23+
min-complexity: 30
3324
gomnd:
3425
settings:
3526
mnd:
@@ -54,31 +45,31 @@ linters:
5445
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
5546
disable-all: true
5647
enable:
57-
- bodyclose
58-
- dogsled
59-
- gocritic
60-
- gofmt
61-
- goimports
62-
- goprintffuncname
63-
- gosimple
64-
- govet
65-
- ineffassign
66-
- lll
67-
- misspell
68-
- nakedret
69-
- rowserrcheck
70-
- staticcheck
71-
- stylecheck
72-
- typecheck
73-
- unconvert
74-
- unparam
75-
- unused
76-
- whitespace
77-
- revive
78-
- dupl
79-
- gocyclo
80-
- gosec
81-
- nolintlint
48+
- bodyclose
49+
- dogsled
50+
- gocritic
51+
- gofmt
52+
- goimports
53+
- goprintffuncname
54+
- gosimple
55+
- govet
56+
- ineffassign
57+
- lll
58+
- misspell
59+
- nakedret
60+
- rowserrcheck
61+
- staticcheck
62+
- stylecheck
63+
- typecheck
64+
- unconvert
65+
- unparam
66+
- unused
67+
- whitespace
68+
- revive
69+
- dupl
70+
- gocyclo
71+
- gosec
72+
- nolintlint
8273

8374
# don't enable:
8475
# - noctx
@@ -107,25 +98,28 @@ linters:
10798
issues:
10899
# Excluding configuration per-path, per-linter, per-text and per-source
109100
exclude-rules:
110-
- path: _test\.go
111-
linters:
112-
- gomnd
113-
- gochecknoglobals
114-
- gosec
115-
- noctx
116-
- goerr113
117-
- goconst
118-
- dupl
119-
- unparam
101+
- path: _test\.go
102+
linters:
103+
- gomnd
104+
- gochecknoglobals
105+
- gosec
106+
- noctx
107+
- goerr113
108+
- goconst
109+
- dupl
110+
- unparam
111+
112+
# https://github.com/go-critic/go-critic/issues/926
113+
- linters:
114+
- gocritic
115+
text: "unnecessaryDefer:"
120116

121-
# https://github.com/go-critic/go-critic/issues/926
122-
- linters:
123-
- gocritic
124-
text: "unnecessaryDefer:"
117+
- text: "should not use dot imports"
118+
path: _test\.go
125119

126120
# silence stupid linter errors
127121
exclude:
128-
- directive `// nolint.*` should be written without leading space
122+
- directive `// nolint.*` should be written without leading space
129123

130124
run:
131125
timeout: 15m

charts/yawol-controller/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ description: Helm chart for yawol-controller
33
name: yawol-controller
44
sources:
55
- https://github.com/stackitcloud/yawol
6-
version: "0.24.0"
7-
appVersion: v0.24.0
6+
version: "0.25.0"
7+
appVersion: v0.25.0

charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancermachines.yaml

+44-35
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.13.0
6+
controller-gen.kubebuilder.io/version: v0.15.0
77
name: loadbalancermachines.yawol.stackit.cloud
88
spec:
99
group: yawol.stackit.cloud
@@ -39,14 +39,19 @@ spec:
3939
API.
4040
properties:
4141
apiVersion:
42-
description: 'APIVersion defines the versioned schema of this representation
43-
of an object. Servers should convert recognized schemas to the latest
44-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
42+
description: |-
43+
APIVersion defines the versioned schema of this representation of an object.
44+
Servers should convert recognized schemas to the latest internal value, and
45+
may reject unrecognized values.
46+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
4547
type: string
4648
kind:
47-
description: 'Kind is a string value representing the REST resource this
48-
object represents. Servers may infer this from the endpoint the client
49-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
49+
description: |-
50+
Kind is a string value representing the REST resource this object represents.
51+
Servers may infer this from the endpoint the client submits requests to.
52+
Cannot be updated.
53+
In CamelCase.
54+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
5055
type: string
5156
metadata:
5257
type: object
@@ -89,9 +94,9 @@ spec:
8994
zone for the LoadBalancer.
9095
type: string
9196
defaultNetwork:
92-
description: DefaultNetwork defines the default/listener network
93-
for the Loadbalancer. TODO Remove optional when Deprecations
94-
are removed
97+
description: |-
98+
DefaultNetwork defines the default/listener network for the Loadbalancer.
99+
TODO Remove optional when Deprecations are removed
95100
properties:
96101
floatingNetID:
97102
description: FloatingNetID defines an openstack ID for the
@@ -101,8 +106,7 @@ spec:
101106
description: NetworkID defines an openstack ID for the network.
102107
type: string
103108
subnetID:
104-
description: SubnetID defines an openstack ID for the
105-
subnet.
109+
description: SubnetID defines an openstack ID for the subnet.
106110
type: string
107111
required:
108112
- networkID
@@ -124,21 +128,23 @@ spec:
124128
virtual machines.
125129
type: string
126130
flavorName:
127-
description: NOT IMPLEMENTED ONLY FlavorID is supported. FlavorName
128-
is the name of the flavor used for requesting virtual machines.
131+
description: |-
132+
NOT IMPLEMENTED ONLY FlavorID is supported.
133+
FlavorName is the name of the flavor used for requesting virtual machines.
129134
FlavorName is only used if FlavorID is not defined.
130135
type: string
131136
flavorSearch:
132-
description: NOT IMPLEMENTED ONLY FlavorID is supported. FlavorSearch
133-
is a search string to find the flavor used for requesting
134-
virtual machines. Search will be performed in metadata of
135-
the flavors. FlavorSearch is only used if FlavorName and
136-
FlavorID are not defined.
137+
description: |-
138+
NOT IMPLEMENTED ONLY FlavorID is supported.
139+
FlavorSearch is a search string to find the flavor used for requesting virtual machines.
140+
Search will be performed in metadata of the flavors.
141+
FlavorSearch is only used if FlavorName and FlavorID are not defined.
137142
type: string
138143
type: object
139144
floatingNetID:
140-
description: 'Deprecated: use defaultNetwork instead FloatingNetID
141-
defines a openstack ID for the floatingNet.'
145+
description: |-
146+
Deprecated: use defaultNetwork instead
147+
FloatingNetID defines a openstack ID for the floatingNet.
142148
type: string
143149
image:
144150
description: Image defines openstack image for the LoadBalancer.
@@ -157,26 +163,28 @@ spec:
157163
machines.
158164
type: string
159165
imageName:
160-
description: NOT IMPLEMENTED ONLY ImageID is supported. ImageName
161-
is the name of the image used for requesting virtual machines.
166+
description: |-
167+
NOT IMPLEMENTED ONLY ImageID is supported.
168+
ImageName is the name of the image used for requesting virtual machines.
162169
ImageName is only used if ImageID is not defined.
163170
type: string
164171
imageSearch:
165-
description: NOT IMPLEMENTED ONLY ImageID is supported. ImageSearch
166-
is a search string to find the image used for requesting
167-
virtual machines. Search will be performed in metadata of
168-
the images. ImageSearch is only used if ImageName and ImageID
169-
are not defined.
172+
description: |-
173+
NOT IMPLEMENTED ONLY ImageID is supported.
174+
ImageSearch is a search string to find the image used for requesting virtual machines.
175+
Search will be performed in metadata of the images.
176+
ImageSearch is only used if ImageName and ImageID are not defined.
170177
type: string
171178
type: object
172179
networkID:
173-
description: 'Deprecated: use defaultNetwork instead NetworkID
174-
defines a openstack ID for the network.'
180+
description: |-
181+
Deprecated: use defaultNetwork instead
182+
NetworkID defines a openstack ID for the network.
175183
type: string
176184
projectID:
177-
description: ProjectID defines an openstack project ID which will
178-
be used instead of the project from the secret ref. If not set
179-
the project from the secret ref will be used.
185+
description: |-
186+
ProjectID defines an openstack project ID which will be used instead of the project from the secret ref.
187+
If not set the project from the secret ref will be used.
180188
type: string
181189
required:
182190
- authSecretRef
@@ -292,8 +300,9 @@ spec:
292300
type: object
293301
type: array
294302
portID:
295-
description: 'Deprecated: use defaultPortID instead PortID contains
296-
the openstack port ID for a LoadBalancerMachine.'
303+
description: |-
304+
Deprecated: use defaultPortID instead
305+
PortID contains the openstack port ID for a LoadBalancerMachine.
297306
type: string
298307
roleBindingName:
299308
description: RoleBindingName contains the namespacedName from the

0 commit comments

Comments
 (0)