Skip to content

Commit f62ce15

Browse files
author
Jason Witkowski
committed
fix: konnectivity extra args override
1 parent 6123d9a commit f62ce15

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

api/v1alpha1/tenantcontrolplane_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ type ImageOverrideTrait struct {
189189
}
190190

191191
// ExtraArgs allows adding additional arguments to said component.
192+
// WARNING - This option can override existing konnectivity
193+
// parameters and cause konnectivity components to misbehave in
194+
// unxpected ways. Only modify if you know what you are doing.
192195
type ExtraArgs []string
193196

194197
type KonnectivityServerSpec struct {

config/crd/bases/kamaji.clastix.io_tenantcontrolplanes.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ spec:
9292
properties:
9393
extraArgs:
9494
description: ExtraArgs allows adding additional arguments
95-
to said component.
95+
to said component. WARNING - This option can override
96+
existing konnectivity parameters and cause konnectivity
97+
components to misbehave in unxpected ways. Only modify
98+
if you know what you are doing.
9699
items:
97100
type: string
98101
type: array
@@ -114,7 +117,10 @@ spec:
114117
properties:
115118
extraArgs:
116119
description: ExtraArgs allows adding additional arguments
117-
to said component.
120+
to said component. WARNING - This option can override
121+
existing konnectivity parameters and cause konnectivity
122+
components to misbehave in unxpected ways. Only modify
123+
if you know what you are doing.
118124
items:
119125
type: string
120126
type: array

config/install.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ spec:
340340
version: v0.0.32
341341
properties:
342342
extraArgs:
343-
description: ExtraArgs allows adding additional arguments to said component.
343+
description: ExtraArgs allows adding additional arguments to said component. WARNING - This option can override existing konnectivity parameters and cause konnectivity components to misbehave in unxpected ways. Only modify if you know what you are doing.
344344
items:
345345
type: string
346346
type: array
@@ -360,7 +360,7 @@ spec:
360360
version: v0.0.32
361361
properties:
362362
extraArgs:
363-
description: ExtraArgs allows adding additional arguments to said component.
363+
description: ExtraArgs allows adding additional arguments to said component. WARNING - This option can override existing konnectivity parameters and cause konnectivity components to misbehave in unxpected ways. Only modify if you know what you are doing.
364364
items:
365365
type: string
366366
type: array

internal/resources/konnectivity/agent.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ func (r *Agent) mutate(ctx context.Context, tenantControlPlane *kamajiv1alpha1.T
164164
r.resource.Spec.Template.Spec.Containers[0].Name = AgentName
165165
r.resource.Spec.Template.Spec.Containers[0].Command = []string{"/proxy-agent"}
166166

167-
args := utilities.ArgsFromSliceToMap(tenantControlPlane.Spec.Addons.Konnectivity.KonnectivityAgentSpec.ExtraArgs)
168-
167+
args := make(map[string]string)
169168
args["-v"] = "8"
170169
args["--logtostderr"] = "true"
171170
args["--ca-cert"] = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
@@ -175,6 +174,12 @@ func (r *Agent) mutate(ctx context.Context, tenantControlPlane *kamajiv1alpha1.T
175174
args["--health-server-port"] = "8134"
176175
args["--service-account-token-path"] = "/var/run/secrets/tokens/konnectivity-agent-token"
177176

177+
extraArgs := utilities.ArgsFromSliceToMap(tenantControlPlane.Spec.Addons.Konnectivity.KonnectivityAgentSpec.ExtraArgs)
178+
179+
for k, v := range extraArgs {
180+
args[k] = v
181+
}
182+
178183
r.resource.Spec.Template.Spec.Containers[0].Args = utilities.ArgsFromMapToSlice(args)
179184
r.resource.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{
180185
{

0 commit comments

Comments
 (0)