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
The crd-from-oas generator derives CRD union discriminator values (the type enum) from Go variant type names: extractVariantNames strips common prefixes/suffixes, then a lower-first camelCase conversion produces the final value. For OIDCIdentityProviderConfig this yields oIDC — an awkward, error-prone, user-facing value in the PortalIdentityProviderRequest CRD (spec.config.type: oIDC, also the JSON field name oIDC).
The upstream OpenAPI spec already defines a clean enum for this purpose (IdentityProviderType: oidc / saml), but the generator does not use it for the discriminator.
Proposed Solution
Candidate approaches (not mutually exclusive):
Use the spec's own type enum values as union discriminator values when available.
Add a per-union discriminator/variant-name override in crd-from-oas/config.yaml.
Improve initialism handling in the lower-first camelCase conversion (lowercase the whole leading initialism run: OIDC → oidc).
Note: oIDC has shipped in v2.3.0 (and exists on release/2.2.x), so changing the enum value is a CRD breaking change. Any fix likely needs to wait for a CRD version bump (e.g. v1alpha1 → v1alpha2) or a major release window.
Problem Statement
The crd-from-oas generator derives CRD union discriminator values (the
typeenum) from Go variant type names:extractVariantNamesstrips common prefixes/suffixes, then a lower-first camelCase conversion produces the final value. ForOIDCIdentityProviderConfigthis yieldsoIDC— an awkward, error-prone, user-facing value in thePortalIdentityProviderRequestCRD (spec.config.type: oIDC, also the JSON field nameoIDC).The upstream OpenAPI spec already defines a clean enum for this purpose (
IdentityProviderType:oidc/saml), but the generator does not use it for the discriminator.Proposed Solution
Candidate approaches (not mutually exclusive):
crd-from-oas/config.yaml.OIDC→oidc).Note:
oIDChas shipped in v2.3.0 (and exists on release/2.2.x), so changing the enum value is a CRD breaking change. Any fix likely needs to wait for a CRD version bump (e.g. v1alpha1 → v1alpha2) or a major release window.Additional Information
extractVariantNames/uniqueUnionDiscriminatorValuesincrd-from-oas/pkg/generator/generator.go(~L3945) → lower-first camelCase (jsonName).oIDCis currently the only awkward discriminator value across all generated API types (portalSAML,tls_server, etc. are all fine).Acceptance Criteria
Documentation is updated with this new feature / enhancement(no user-facing docs change expected; the CRD schema itself is the documentation)Helm chart is updated to work with this feature / enhancement(no chart changes needed)oidc/saml) inPortalIdentityProviderRequestmanifests