You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: Remove deprecated proxy handling when Provider v1 is released.
315
-
deprecatedProxy:=provider.Spec.Proxy
316
-
ifdeprecatedProxy!="" {
317
-
log.FromContext(ctx).Error(nil, "warning: spec.proxy is deprecated, please use spec.proxySecretRef instead. Support for this field will be removed in v1.")
returnnil, "", fmt.Errorf("failed to read secret: %w", err)
329
-
}
330
-
331
-
ifval, ok:=secret.Data["address"]; ok {
332
-
iflen(val) >2048 {
333
-
returnnil, "", fmt.Errorf("invalid address in secret: address exceeds maximum length of %d bytes", 2048)
334
-
}
335
-
webhook=strings.TrimSpace(string(val))
336
-
}
337
-
338
-
ifval, ok:=secret.Data["password"]; ok {
339
-
password=strings.TrimSpace(string(val))
340
-
}
341
-
342
-
ifval, ok:=secret.Data["proxy"]; ok {
343
-
deprecatedProxy=strings.TrimSpace(string(val))
344
-
_, err:=url.Parse(deprecatedProxy)
345
-
iferr!=nil {
346
-
returnnil, "", fmt.Errorf("invalid 'proxy' in secret '%s/%s'", secret.Namespace, secret.Name)
347
-
}
348
-
log.FromContext(ctx).Error(nil, "warning: specifying proxy with 'proxy' key in the referenced secret is deprecated, use spec.proxySecretRef with 'address' key instead. Support for the 'proxy' key will be removed in v1.")
returnnil, nil, fmt.Errorf("failed to read secret: %w", err)
318
+
}
350
319
351
-
ifval, ok:=secret.Data["token"]; ok {
352
-
token=strings.TrimSpace(string(val))
320
+
ifval, ok:=secret.Data["address"]; ok {
321
+
iflen(val) >2048 {
322
+
returnnil, nil, fmt.Errorf("invalid address in secret: address exceeds maximum length of %d bytes", 2048)
353
323
}
324
+
}
354
325
355
-
ifval, ok:=secret.Data["username"]; ok {
356
-
username=strings.TrimSpace(string(val))
357
-
}
358
-
359
-
ifh, ok:=secret.Data["headers"]; ok {
360
-
err:=yaml.Unmarshal(h, &headers)
361
-
iferr!=nil {
362
-
returnnil, "", fmt.Errorf("failed to read headers from secret: %w", err)
363
-
}
326
+
ifval, ok:=secret.Data["proxy"]; ok {
327
+
deprecatedProxy:=strings.TrimSpace(string(val))
328
+
if_, err:=url.Parse(deprecatedProxy); err!=nil {
329
+
returnnil, nil, fmt.Errorf("invalid 'proxy' in secret '%s'", secretName.String())
364
330
}
331
+
log.FromContext(ctx).Error(nil, "warning: specifying proxy with 'proxy' key in the referenced secret is deprecated, use spec.proxySecretRef with 'address' key instead. Support for the 'proxy' key will be removed in v1.")
// TODO: Remove deprecated proxy handling when Provider v1 is released.
380
+
ifprovider.Spec.Proxy!="" {
381
+
log.FromContext(ctx).Error(nil, "warning: spec.proxy is deprecated, please use spec.proxySecretRef instead. Support for this field will be removed in v1.")
0 commit comments