@@ -102,7 +102,15 @@ func (r *Agent) mutate(ctx context.Context, tenantControlPlane *kamajiv1alpha1.T
102
102
return func () error {
103
103
logger := log .FromContext (ctx , "resource" , r .GetName ())
104
104
105
- address , _ , err := tenantControlPlane .AssignedControlPlaneAddress ()
105
+ var address string
106
+ var err error
107
+
108
+ if len (tenantControlPlane .Spec .Addons .Konnectivity .KonnectivityServerSpec .Address ) != 0 {
109
+ address = tenantControlPlane .Spec .Addons .Konnectivity .KonnectivityServerSpec .Address
110
+ } else {
111
+ address , _ , err = tenantControlPlane .AssignedControlPlaneAddress ()
112
+ }
113
+
106
114
if err != nil {
107
115
logger .Error (err , "unable to retrieve the Tenant Control Plane address" )
108
116
@@ -164,8 +172,7 @@ func (r *Agent) mutate(ctx context.Context, tenantControlPlane *kamajiv1alpha1.T
164
172
r .resource .Spec .Template .Spec .Containers [0 ].Name = AgentName
165
173
r .resource .Spec .Template .Spec .Containers [0 ].Command = []string {"/proxy-agent" }
166
174
167
- args := utilities .ArgsFromSliceToMap (tenantControlPlane .Spec .Addons .Konnectivity .KonnectivityAgentSpec .ExtraArgs )
168
-
175
+ args := make (map [string ]string )
169
176
args ["-v" ] = "8"
170
177
args ["--logtostderr" ] = "true"
171
178
args ["--ca-cert" ] = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
@@ -175,6 +182,12 @@ func (r *Agent) mutate(ctx context.Context, tenantControlPlane *kamajiv1alpha1.T
175
182
args ["--health-server-port" ] = "8134"
176
183
args ["--service-account-token-path" ] = "/var/run/secrets/tokens/konnectivity-agent-token"
177
184
185
+ extraArgs := utilities .ArgsFromSliceToMap (tenantControlPlane .Spec .Addons .Konnectivity .KonnectivityAgentSpec .ExtraArgs )
186
+
187
+ for k , v := range extraArgs {
188
+ args [k ] = v
189
+ }
190
+
178
191
r .resource .Spec .Template .Spec .Containers [0 ].Args = utilities .ArgsFromMapToSlice (args )
179
192
r .resource .Spec .Template .Spec .Containers [0 ].VolumeMounts = []corev1.VolumeMount {
180
193
{
0 commit comments