Skip to content

Commit 13d0fb6

Browse files
committed
ci: enable debug verbosity on e2e providers
Signed-off-by: Andrea Mazzotti <[email protected]>
1 parent bc3add8 commit 13d0fb6

File tree

4 files changed

+126
-52
lines changed

4 files changed

+126
-52
lines changed

charts/rancher-turtles-providers/values.schema.json

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
},
2525
"version": {
2626
"type": "string",
27-
"description": "Optional provider version."
27+
"description": "Optional provider version."
2828
},
2929
"credentials": {
3030
"type": "object",
31-
"description": "Optional Secret reference containing Rancher credentials",
31+
"description": "Optional Secret reference containing Rancher credentials",
3232
"required": [
3333
"name",
3434
"namespace"
@@ -46,7 +46,7 @@
4646
},
4747
"configSecret": {
4848
"type": "object",
49-
"description": "ConfigSecret is the object with name and namespace of the Secret providing the configuration variables for the current provider instance, like e.g. credentials.",
49+
"description": "ConfigSecret is the object with name and namespace of the Secret providing the configuration variables for the current provider instance, like e.g. credentials.",
5050
"required": [
5151
"name",
5252
"namespace"
@@ -64,7 +64,7 @@
6464
},
6565
"features": {
6666
"type": "object",
67-
"description": "Optional feature flags for this provider.",
67+
"description": "Optional feature flags for this provider.",
6868
"properties": {
6969
"machinePool": {
7070
"type": "boolean",
@@ -82,25 +82,31 @@
8282
},
8383
"variables": {
8484
"type": "object",
85-
"description": "Optional environment variables exposed to the controller manager.",
85+
"description": "Optional environment variables exposed to the controller manager.",
8686
"additionalProperties": {
8787
"type": "string"
8888
}
8989
},
9090
"manager": {
9191
"type": "object",
92-
"description": "Optional controller manager settings.",
92+
"description": "Optional controller manager settings.",
9393
"properties": {
9494
"syncPeriod": {
9595
"type": "string",
9696
"description": "Controller sync period duration, e.g. '5m'"
97+
},
98+
"verbosity": {
99+
"type": "number",
100+
"description": "Verbosity set the logs verbosity. Defaults to 1.",
101+
"minimum": 1,
102+
"maximum": 5
97103
}
98104
}
99105
},
100106
"fetchConfig": {
101107
"type": "object",
102-
"description": "Override default artifact source via URL or OCI (specify one).",
103-
"oneOf": [
108+
"description": "Override default artifact source via URL or OCI (specify one).",
109+
"oneOf": [
104110
{
105111
"properties": {
106112
"url": {
@@ -109,18 +115,22 @@
109115
}
110116
},
111117
"additionalProperties": false,
112-
"required": ["url"]
118+
"required": [
119+
"url"
120+
]
113121
},
114122
{
115-
"properties": {
123+
"properties": {
116124
"oci": {
117125
"type": "string",
118126
"description": "OCI to be used for fetching the provider components and metadata."
119127
}
120128
},
121129
"additionalProperties": false,
122-
"required": ["oci"]
123-
}
130+
"required": [
131+
"oci"
132+
]
133+
}
124134
]
125135
}
126136
}
@@ -130,19 +140,39 @@
130140
"properties": {
131141
"providers": {
132142
"type": "object",
133-
"description": "Providers configuration.",
143+
"description": "Providers configuration.",
134144
"properties": {
135-
"addonFleet": { "$ref": "#/$defs/providerSchema"},
136-
"bootstrapKubeadm": { "$ref": "#/$defs/providerSchema"},
137-
"bootstrapRKE2": { "$ref": "#/$defs/providerSchema"},
138-
"controlplaneKubeadm": { "$ref": "#/$defs/providerSchema"},
139-
"controlplaneRKE2": { "$ref": "#/$defs/providerSchema"},
140-
"infrastructureAWS": { "$ref": "#/$defs/providerSchema"},
141-
"infrastructureAzure": { "$ref": "#/$defs/providerSchema"},
142-
"infrastructureDocker": { "$ref": "#/$defs/providerSchema"},
143-
"infrastructureGCP": { "$ref": "#/$defs/providerSchema"},
144-
"infrastructureVSphere": { "$ref": "#/$defs/providerSchema"}
145+
"addonFleet": {
146+
"$ref": "#/$defs/providerSchema"
147+
},
148+
"bootstrapKubeadm": {
149+
"$ref": "#/$defs/providerSchema"
150+
},
151+
"bootstrapRKE2": {
152+
"$ref": "#/$defs/providerSchema"
153+
},
154+
"controlplaneKubeadm": {
155+
"$ref": "#/$defs/providerSchema"
156+
},
157+
"controlplaneRKE2": {
158+
"$ref": "#/$defs/providerSchema"
159+
},
160+
"infrastructureAWS": {
161+
"$ref": "#/$defs/providerSchema"
162+
},
163+
"infrastructureAzure": {
164+
"$ref": "#/$defs/providerSchema"
165+
},
166+
"infrastructureDocker": {
167+
"$ref": "#/$defs/providerSchema"
168+
},
169+
"infrastructureGCP": {
170+
"$ref": "#/$defs/providerSchema"
171+
},
172+
"infrastructureVSphere": {
173+
"$ref": "#/$defs/providerSchema"
174+
}
145175
}
146-
}
176+
}
147177
}
148178
}

charts/rancher-turtles-providers/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ providers:
3737
# manager: Optional controller manager settings.
3838
# manager:
3939
# syncPeriod: "5m"
40+
# verbosity: 5
4041
# bootstrapKubeadm: Kubeadm Bootstrap Provider.
4142
bootstrapKubeadm:
4243
# enabled: Enables the installation of this provider.
@@ -70,6 +71,7 @@ providers:
7071
# manager: Optional controller manager settings.
7172
# manager:
7273
# syncPeriod: "5m"
74+
# verbosity: 5
7375
# bootstrapRKE2: RKE2 Bootstrap Provider.
7476
bootstrapRKE2:
7577
# enabled: Enables the installation of this provider.
@@ -103,6 +105,7 @@ providers:
103105
# manager: Optional controller manager settings.
104106
# manager:
105107
# syncPeriod: "5m"
108+
# verbosity: 5
106109
# controlplaneKubeadm: Kubeadm Control Plane Provider.
107110
controlplaneKubeadm:
108111
# enabled: Enables the installation of this provider.
@@ -136,6 +139,7 @@ providers:
136139
# manager: Optional controller manager settings.
137140
# manager:
138141
# syncPeriod: "5m"
142+
# verbosity: 5
139143
# controlplaneRKE2: RKE2 Control Plane Provider.
140144
controlplaneRKE2:
141145
# enabled: Enables the installation of this provider.
@@ -169,6 +173,7 @@ providers:
169173
# manager: Optional controller manager settings.
170174
# manager:
171175
# syncPeriod: "5m"
176+
# verbosity: 5
172177
# infrastructureAWS: AWS Infrastructure Provider (CAPA).
173178
infrastructureAWS:
174179
# enabled: Enables the installation of this provider.
@@ -202,6 +207,7 @@ providers:
202207
# manager: Optional controller manager settings.
203208
# manager:
204209
# syncPeriod: "5m"
210+
# verbosity: 5
205211
# infrastructureAzure: Azure Infrastructure Provider (CAPZ).
206212
infrastructureAzure:
207213
# enabled: Enables the installation of this provider.
@@ -235,6 +241,7 @@ providers:
235241
# manager: Optional controller manager settings.
236242
# manager:
237243
# syncPeriod: "5m"
244+
# verbosity: 5
238245
# infrastructureDocker: Docker Infrastructure Provider (CAPD).
239246
infrastructureDocker:
240247
# enabled: Enables the installation of this provider.
@@ -268,6 +275,7 @@ providers:
268275
# manager: Optional controller manager settings.
269276
# manager:
270277
# syncPeriod: "5m"
278+
# verbosity: 5
271279
# infrastructureGCP: GCP Infrastructure Provider (CAPG).
272280
infrastructureGCP:
273281
# enabled: Enables the installation of this provider.
@@ -302,6 +310,7 @@ providers:
302310
# manager: Optional controller manager settings.
303311
# manager:
304312
# syncPeriod: "5m"
313+
# verbosity: 5
305314
infrastructureVSphere:
306315
# enabled: Enables the installation of this provider.
307316
enabled: false
@@ -335,3 +344,4 @@ providers:
335344
# manager: Optional controller manager settings.
336345
# manager:
337346
# syncPeriod: "5m"
347+
# verbosity: 5

scripts/turtles-dev.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,23 @@ install_local_providers_chart() {
118118

119119
helm upgrade --install rancher-turtles-providers out/charts/rancher-turtles-providers \
120120
-n cattle-turtles-system \
121+
--set providers.bootstrapRKE2.manager.verbosity=5 \
122+
--set providers.controlplaneRKE2.manager.verbosity=5 \
121123
--set providers.bootstrapKubeadm.enabled=true \
124+
--set providers.bootstrapKubeadm.manager.verbosity=5 \
122125
--set providers.controlplaneKubeadm.enabled=true \
126+
--set providers.controlplaneKubeadm.manager.verbosity=5 \
123127
--set providers.infrastructureDocker.enabled=true \
128+
--set providers.infrastructureDocker.manager.verbosity=5 \
124129
--set providers.infrastructureAWS.enabled=true \
130+
--set providers.infrastructureAWS.manager.verbosity=5 \
125131
--set providers.infrastructureAzure.enabled=true \
132+
--set providers.infrastructureAzure.manager.verbosity=5 \
126133
--set providers.infrastructureGCP.enabled=true \
134+
--set providers.infrastructureGCP.manager.verbosity=5 \
127135
--set providers.infrastructureGCP.variables.GCP_B64ENCODED_CREDENTIALS="" \
128136
--set providers.infrastructureVSphere.enabled=true \
137+
--set providers.infrastructureVSphere.manager.verbosity=5 \
129138
--create-namespace --wait \
130139
--timeout 180s
131140
}

test/testenv/providers.go

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ import (
4141
)
4242

4343
const (
44-
bootstrapKubeadmPath = "providers.bootstrapKubeadm.enabled"
45-
controlplaneKubeadmPath = "providers.controlplaneKubeadm.enabled"
46-
dockerPath = "providers.infrastructureDocker.enabled"
47-
awsPath = "providers.infrastructureAWS.enabled"
48-
azurePath = "providers.infrastructureAzure.enabled"
49-
gcpPath = "providers.infrastructureGCP.enabled"
50-
vspherePath = "providers.infrastructureVSphere.enabled"
44+
providerEnabledKey = "enabled"
45+
providerVerbosityKey = "manager.verbosity"
46+
debugVerbosityValue = "5"
47+
48+
bootstrapRKE2Path = "providers.bootstrapRKE2."
49+
controlplaneRKE2Path = "providers.controlplaneRKE2."
50+
bootstrapKubeadmPath = "providers.bootstrapKubeadm."
51+
controlplaneKubeadmPath = "providers.controlplaneKubeadm."
52+
dockerPath = "providers.infrastructureDocker."
53+
awsPath = "providers.infrastructureAWS."
54+
azurePath = "providers.infrastructureAzure."
55+
gcpPath = "providers.infrastructureGCP."
56+
vspherePath = "providers.infrastructureVSphere."
5157

5258
defaultOCIRegistry = "registry.rancher.com/rancher/cluster-api-controller-components"
5359

@@ -172,19 +178,29 @@ func DeployRancherTurtlesProviders(ctx context.Context, input DeployRancherTurtl
172178
for _, p := range providerList {
173179
provider := strings.TrimSpace(strings.ToLower(p))
174180
switch provider {
181+
case "rke2":
182+
values[bootstrapRKE2Path+providerVerbosityKey] = debugVerbosityValue
183+
values[controlplaneRKE2Path+providerVerbosityKey] = debugVerbosityValue
175184
case "kubeadm":
176-
values[bootstrapKubeadmPath] = "true"
177-
values[controlplaneKubeadmPath] = "true"
185+
values[bootstrapKubeadmPath+providerEnabledKey] = "true"
186+
values[bootstrapKubeadmPath+providerVerbosityKey] = debugVerbosityValue
187+
values[controlplaneKubeadmPath+providerEnabledKey] = "true"
188+
values[controlplaneKubeadmPath+providerVerbosityKey] = debugVerbosityValue
178189
case "docker", "capd":
179-
values[dockerPath] = "true"
190+
values[dockerPath+providerEnabledKey] = "true"
191+
values[dockerPath+providerVerbosityKey] = debugVerbosityValue
180192
case "aws", "capa":
181-
values[awsPath] = "true"
193+
values[awsPath+providerEnabledKey] = "true"
194+
values[awsPath+providerVerbosityKey] = debugVerbosityValue
182195
case "azure", "capz":
183-
values[azurePath] = "true"
196+
values[azurePath+providerEnabledKey] = "true"
197+
values[azurePath+providerVerbosityKey] = debugVerbosityValue
184198
case "gcp", "capg":
185-
values[gcpPath] = "true"
199+
values[gcpPath+providerEnabledKey] = "true"
200+
values[gcpPath+providerVerbosityKey] = debugVerbosityValue
186201
case "vsphere", "capv":
187-
values[vspherePath] = "true"
202+
values[vspherePath+providerEnabledKey] = "true"
203+
values[vspherePath+providerVerbosityKey] = debugVerbosityValue
188204
case "", "all":
189205
default:
190206
log.FromContext(ctx).Info("Unknown provider in TURTLES_PROVIDERS, ignoring", "provider", provider)
@@ -295,13 +311,22 @@ func runProviderMigration(ctx context.Context, scriptPath, kubeconfigPath string
295311
}
296312

297313
func enableAllProviders(values map[string]string) {
298-
values[bootstrapKubeadmPath] = "true"
299-
values[controlplaneKubeadmPath] = "true"
300-
values[dockerPath] = "true"
301-
values[awsPath] = "true"
302-
values[azurePath] = "true"
303-
values[gcpPath] = "true"
304-
values[vspherePath] = "true"
314+
values[bootstrapRKE2Path+providerVerbosityKey] = debugVerbosityValue
315+
values[controlplaneRKE2Path+providerVerbosityKey] = debugVerbosityValue
316+
values[bootstrapKubeadmPath+providerEnabledKey] = "true"
317+
values[bootstrapKubeadmPath+providerVerbosityKey] = debugVerbosityValue
318+
values[controlplaneKubeadmPath+providerEnabledKey] = "true"
319+
values[controlplaneKubeadmPath+providerVerbosityKey] = debugVerbosityValue
320+
values[dockerPath+providerEnabledKey] = "true"
321+
values[dockerPath+providerVerbosityKey] = debugVerbosityValue
322+
values[awsPath+providerEnabledKey] = "true"
323+
values[awsPath+providerVerbosityKey] = debugVerbosityValue
324+
values[azurePath+providerEnabledKey] = "true"
325+
values[azurePath+providerVerbosityKey] = debugVerbosityValue
326+
values[gcpPath+providerEnabledKey] = "true"
327+
values[gcpPath+providerVerbosityKey] = debugVerbosityValue
328+
values[vspherePath+providerEnabledKey] = "true"
329+
values[vspherePath+providerVerbosityKey] = debugVerbosityValue
305330
}
306331

307332
func getAdoptArgsForEnabledProviders(enabled []string, values map[string]string) []string {
@@ -335,25 +360,25 @@ func getAdoptArgsForEnabledProviders(enabled []string, values map[string]string)
335360

336361
func getEnabledCAPIProviders(values map[string]string) []string {
337362
out := []string{}
338-
if values[bootstrapKubeadmPath] == "true" {
363+
if values[bootstrapKubeadmPath+providerEnabledKey] == "true" {
339364
out = append(out, providerKubeadmBootstrap)
340365
}
341-
if values[controlplaneKubeadmPath] == "true" {
366+
if values[controlplaneKubeadmPath+providerEnabledKey] == "true" {
342367
out = append(out, providerKubeadmControlPlane)
343368
}
344-
if values[dockerPath] == "true" {
369+
if values[dockerPath+providerEnabledKey] == "true" {
345370
out = append(out, providerDocker)
346371
}
347-
if values[awsPath] == "true" {
372+
if values[awsPath+providerEnabledKey] == "true" {
348373
out = append(out, providerAWS)
349374
}
350-
if values[azurePath] == "true" {
375+
if values[azurePath+providerEnabledKey] == "true" {
351376
out = append(out, providerAzure)
352377
}
353-
if values[gcpPath] == "true" {
378+
if values[gcpPath+providerEnabledKey] == "true" {
354379
out = append(out, providerGCP)
355380
}
356-
if values[vspherePath] == "true" {
381+
if values[vspherePath+providerEnabledKey] == "true" {
357382
out = append(out, providerVSphere)
358383
}
359384
return out

0 commit comments

Comments
 (0)