Open cgwalters opened 3 years ago
The approach proposed above would break the ability of callers to programmatically detect the error. All Ignition errors use pre-created error objects for that reason, which unfortunately means that we can't use format strings.
We could perhaps change the error message to specify the range of currently supported versions, and/or have the engine detect the error and log an additional line that reports the detected config version.
Maybe add a new Parse2
method (naming is hard) that has the same signature but requires callers to use errors.Is()
instead?
For RHCOS we're going to have a long tail of dealing with people trying to boot 4.6+ with spec2x Ignition. Further we have the opposite case here: https://github.com/openshift/oc/pull/628#discussion_r524524863
Basically it'd be nice if in the API when we fail to parse a config because the version is unsupported we say which version was found. This might be kind of an API break if we use e.g. https://blog.golang.org/go1.13-errors to wrap...I was looking at