From https://github.com/kubewarden/policy-fetcher/pull/55#issuecomment-1055527972, right now, VerificationConfig has a hardcoded version. If we were to bump the version and change the VerificationConfigstruct, or any struct inside of it, it will break for consumers (given that we set deny_unknown_fields).
Solution you'd like
Provide an aliased type, VerificationConfigLatest or similar, that maps to the latest config.
Provide versioned types, VerificationConfigV1, that implements the current type.
Provide an enum that maps the latest version to the different versions. This enum can implement TryInto in the future, to seamlessly cast versions to the latest.
Consumers will only consume VerificationConfigLatest.
Is your feature request related to a problem?
From https://github.com/kubewarden/policy-fetcher/pull/55#issuecomment-1055527972, right now,
VerificationConfig
has a hardcoded version. If we were to bump the version and change theVerificationConfig
struct, or any struct inside of it, it will break for consumers (given that we setdeny_unknown_fields
).Solution you'd like
Provide an aliased type,
VerificationConfigLatest
or similar, that maps to the latest config. Provide versioned types,VerificationConfigV1
, that implements the current type. Provide an enum that maps the latest version to the different versions. This enum can implementTryInto
in the future, to seamlessly cast versions to the latest.Consumers will only consume
VerificationConfigLatest
.Alternatives you've considered
No response
Anything else?
No response