How do I upgrade Red Hat Connectivity Link (RHCL) when AuthPolicy custom resources use fields not available in all served versions of the CRD?
Environment
- Product: Red Hat Connectivity Link (RHCL)
- Versions Affected: Upgrades where AuthConfig CRD v1beta2 and v1beta3 are both served but v1beta2 lacks schema definitions for fields added in v1beta3
- Specifically tested: RHCL 1.3.3 → 1.3.4
- May affect other version transitions
- Component: Authorino Operator, AuthPolicy/AuthConfig CRDs
- Installation Method: Operator Lifecycle Manager (OLM)
Issue
KCS Solution: Workaround for CONNLINK-1131
When upgrading RHCL via OLM, the upgrade fails with a validation error if AuthPolicy custom resources use certain fields that were introduced in AuthConfig v1beta3.
Example error message:
error validating existing CRs against new CRD's schema for "authconfigs.authorino.kuadrant.io":
error validating authorino.kuadrant.io/v1beta2, Kind=AuthConfig:
"spec.authentication.*.when[0]" must validate one and only one schema (oneOf). Found none valid
Symptoms:
- InstallPlan enters
Failedstate - Authorino operator CSV shows
Pendingphase - Other operators (DNS, Limitador) may show
UpgradePending - Upgrade does not complete
When does this occur?
- During OLM-managed upgrades between versions where:
- AuthConfig CRD serves both v1beta2 and v1beta3
- v1beta2 schema lacks definitions for certain fields added in v1beta3
- Existing AuthPolicy CRs use any of the affected v1beta3-only fields (see Root Cause section for complete list)
Resolution
Recommended Approach: Proactive Workaround
Use this method BEFORE starting the upgrade to avoid failure.
-
Before approving the upgrade InstallPlan, temporarily disable v1beta2 serving on the AuthConfig CRD:
kubectl patch crd authconfigs.authorino.kuadrant.io --type=json -p='[ {"op": "replace", "path": "/spec/versions/0/served", "value": false} ]' -
Verify the patch was applied:
kubectl get crd authconfigs.authorino.kuadrant.io -o jsonpath='{range .spec.versions[*]}{.name}{" served="}{.served}{"\n"}{end}'Expected output:
v1beta2 served=false v1beta3 served=true -
Proceed with the upgrade by approving the InstallPlan via your preferred method (OpenShift Console, CLI, GitOps, etc.)
-
Wait for the upgrade to complete. Monitor CSV status:
kubectl get csv -n kuadrant-system | grep -E "authorino|rhcl|dns|limitador" -
Verify all operators show
Succeededphase.
Result: The CRD patch is automatically restored by OLM after the upgrade completes. No manual cleanup is required.
Why this works:
- OLM validates existing CRs against ALL served CRD versions during upgrades
- Temporarily disabling v1beta2 forces OLM to validate only against v1beta3
- v1beta3 includes the schema definitions for these fields, so validation passes
- The upgrade succeeds and OLM restores v1beta2 serving from the new CSV
Alternative: Reactive Recovery (After Upgrade Failure)
Use this method ONLY if the upgrade has already failed and cannot be rolled back.
⚠️ Warning: This procedure is complex and requires active monitoring. Use the proactive workaround whenever possible.
Prerequisites
- Failed InstallPlan with validation error
- Access to kuadrant-system namespace
- Manual approval workflow enabled
Steps
-
Apply the CRD patch to disable v1beta2 serving:
kubectl patch crd authconfigs.authorino.kuadrant.io --type=json -p='[ {"op": "replace", "path": "/spec/versions/0/served", "value": false} ]' -
Delete the RHCL subscription:
kubectl delete subscription rhcl-operator -n kuadrant-system -
Delete all CSVs from the failed upgrade:
kubectl delete csv -n kuadrant-system \ $(kubectl get csv -n kuadrant-system -o name | grep -E "rhcl-operator|authorino-operator|dns-operator|limitador-operator") -
Delete dependency operator subscriptions:
kubectl delete subscription -n kuadrant-system \ authorino-operator-stable-redhat-operators-openshift-marketplace \ dns-operator-stable-redhat-operators-openshift-marketplace \ limitador-operator-stable-redhat-operators-openshift-marketplace -
Recreate the RHCL subscription with the target version specified:
kubectl apply -f - <<'EOFINNER' apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: rhcl-operator namespace: kuadrant-system spec: channel: stable installPlanApproval: Manual name: rhcl-operator source: redhat-operators sourceNamespace: openshift-marketplace startingCSV: rhcl-operator.v1.3.4 # Replace with target version EOFINNERImportant: Replace
v1.3.4with your intended target version. WithoutstartingCSV, OLM will select the latest available version. -
Wait for the new InstallPlan to be created (approximately 30 seconds):
kubectl get installplan -n kuadrant-system -
Approve the new InstallPlan:
INSTALLPLAN=$(kubectl get installplan -n kuadrant-system --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1].metadata.name}') kubectl patch installplan $INSTALLPLAN -n kuadrant-system --type=json -p='[ {"op": "replace", "path": "/spec/approved", "value": true} ]' -
Critical: Monitor the upgrade and re-apply the CRD patch if needed.
The Authorino CSV may restore v1beta2 serving when it installs. If this happens before the RHCL CSV completes, the validation error will recur.
Monitor CSV status:
watch kubectl get csv -n kuadrant-systemIf you observe Authorino in
Succeededphase but RHCL still inInstallingor showing errors, re-apply the patch:kubectl patch crd authconfigs.authorino.kuadrant.io --type=json -p='[ {"op": "replace", "path": "/spec/versions/0/served", "value": false} ]'OLM will automatically retry and should succeed within 60 seconds.
-
Verify all operators reached
Succeededphase:kubectl get csv -n kuadrant-system -o custom-columns='NAME:.metadata.name,VERSION:.spec.version,PHASE:.status.phase' | grep -E "NAME|authorino|rhcl|dns|limitador" -
Verify user resources are preserved:
kubectl get authpolicy -A
Root Cause
During OLM-managed operator upgrades, the Operator Lifecycle Manager validates all existing custom resources against the schemas defined in ALL served versions of the associated CRD.
When upgrading RHCL:
- The current AuthConfig CRD serves both v1beta2 and v1beta3
- Several fields were added in v1beta3 that do not exist in the v1beta2 schema
- Existing AuthPolicy CRs that use these v1beta3-only fields create AuthConfig resources with these fields
- During the upgrade, OLM attempts to validate these AuthConfigs against both v1beta2 and v1beta3 schemas
- Validation against v1beta2 fails because the schema does not include definitions for these fields
- OLM marks the InstallPlan as Failed and halts the upgrade
The workaround temporarily disables v1beta2 serving, forcing OLM to validate only against v1beta3, which includes all field definitions.
Note: Most of these fields support Common Expression Language (CEL), but the issue is caused by the schema incompatibility between v1beta2 and v1beta3, not by the use of CEL itself.
Affected AuthPolicy Fields
The following fields were introduced in AuthConfig v1beta3 and will trigger this validation error if used in AuthPolicy CRs:
Predicates (when conditions):
spec.rules.when.predicatespec.rules.authentication.when.predicatespec.rules.metadata.when.predicatespec.rules.authorization.when.predicatespec.rules.authorization.patternMatching.patterns.predicatespec.rules.response.success.headers.when.predicatespec.rules.response.success.dynamicMetadata.when.predicate
URL expressions:
spec.rules.metadata.userInfo.userInfoUrlspec.rules.metadata.http.urlExpressionspec.rules.authorization.opa.externalPolicy.urlExpressionspec.rules.callbacks.http.urlExpression
Other expressions:
spec.rules.authentication.plain.expression
Upstream Issue: Content from github.com is not included.https://github.com/Kuadrant/authorino/issues/627
Diagnostic Steps
To confirm this is the issue affecting your upgrade:
-
Check if the InstallPlan is in Failed state:
kubectl get installplan -n kuadrant-system -
Examine the InstallPlan for validation errors:
kubectl get installplan <installplan-name> -n kuadrant-system -o jsonpath='{.status.message}'Look for:
- References to
authconfigs.authorino.kuadrant.io - Mentions of
v1beta2 - Validation errors containing
when[0]oroneOf
- References to
-
Check if your AuthPolicy CRs use any of the affected v1beta3-only fields:
kubectl get authpolicy -A -o yaml | grep -E "predicate:|\.expression:|urlExpression:|userInfoUrl:"If you see any of these field names, this workaround applies.
Alternative check for specific patterns:
kubectl get authpolicy -A -o yaml | grep -A 2 -E "when:|plain:|urlExpression:|userInfoUrl:|patterns:" -
Verify which CRD versions are served:
kubectl get crd authconfigs.authorino.kuadrant.io -o jsonpath='{range .spec.versions[*]}{.name}{" served="} {.served}{"\n"}{end}'
Diagnostic Steps
To confirm this is the issue affecting your upgrade:
-
Check if the InstallPlan is in Failed state:
kubectl get installplan -n kuadrant-system -
Examine the InstallPlan for validation errors:
kubectl get installplan <installplan-name> -n kuadrant-system -o jsonpath='{.status.message}'Look for:
- References to
authconfigs.authorino.kuadrant.io - Mentions of
v1beta2 - Validation errors containing
when[0]oroneOf
- References to
-
Check if your AuthPolicy CRs use any of the affected v1beta3-only fields:
kubectl get authpolicy -A -o yaml | grep -E "predicate:|\.expression:|urlExpression:|userInfoUrl:"If you see any of these field names, this workaround applies.
Alternative check for specific patterns:
kubectl get authpolicy -A -o yaml | grep -A 2 -E "when:|plain:|urlExpression:|userInfoUrl:|patterns:" -
Verify which CRD versions are served:
kubectl get crd authconfigs.authorino.kuadrant.io -o jsonpath='{range .spec.versions[*]}{.name}{" served="} {.served}{"\n"}{end}'
Additional Information
Best Practices:
- Always use the proactive workaround when planning upgrades
- Test upgrades in non-production environments first
- Ensure you have recent backups of all custom resources
- Monitor operator pod logs during upgrades for early warning signs
Limitations:
- The CRD patch must be monitored during reactive recovery
- Reactive recovery requires subscription recreation, which may cause brief service interruption
- Without specifying
startingCSV, OLM will select the latest version, not the originally intended version
Future Versions:
A fix for the underlying validation schema issue is being tracked. Once released, this workaround will no longer be necessary for upgrades to/from versions containing the fix.
Related Information
- Content from docs.kuadrant.io is not included.Kuadrant Documentation
- Content from olm.operatorframework.io is not included.Operator Lifecycle Manager Documentation
- Content from docs.kuadrant.io is not included.AuthPolicy API Reference
- Upstream Issue: https://github.com/Kuadrant/authorino/issues/627
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.