Skip to content

Commit 3cc8e0f

Browse files
committed
fix: log deprecation warning when old snake_case auth type is used
1 parent bedda93 commit 3cc8e0f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

cmd/thv-operator/pkg/vmcpconfig/converter.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,15 @@ func (c *Converter) convertBackendAuthConfig(
452452
}, nil
453453
}
454454

455-
// If type is "externalAuthConfigRef", resolve the MCPExternalAuthConfig
456-
if crdConfig.Type == mcpv1alpha1.BackendAuthTypeExternalAuthConfigRef {
455+
// Handle deprecated snake_case value
456+
if crdConfig.Type == mcpv1alpha1.DeprecatedBackendAuthTypeExternalAuthConfigRef {
457+
log.FromContext(ctx).Info("backend auth type value \"external_auth_config_ref\" is deprecated, use \"externalAuthConfigRef\" instead",
458+
"backend", backendName, "vmcp", vmcp.Name)
459+
}
460+
461+
// If type is "externalAuthConfigRef" (or deprecated "external_auth_config_ref"), resolve the MCPExternalAuthConfig
462+
if crdConfig.Type == mcpv1alpha1.BackendAuthTypeExternalAuthConfigRef ||
463+
crdConfig.Type == mcpv1alpha1.DeprecatedBackendAuthTypeExternalAuthConfigRef {
457464
if crdConfig.ExternalAuthConfigRef == nil {
458465
return nil, fmt.Errorf("backend %s: externalAuthConfigRef type requires externalAuthConfigRef field", backendName)
459466
}

0 commit comments

Comments
 (0)