Hide Forgot
Description of problem: While trying to set keepYoungerThan, the client returns spec.keepYoungerThan in body must be of type integer: "string" Version-Release number of selected component (if applicable): Openshift Container Platform 4.4 How reproducible: $ cat <<EOF >>image-pruner.yaml apiVersion: imageregistry.operator.openshift.io/v1 kind: ImagePruner metadata: name: imageprunertest spec: schedule: "*/0 * * * *" suspend: false keepTagRevisions: 3 keepYoungerThan: 60m startingDeadlineSeconds: 60 successfulJobsHistoryLimit: 3 failedJobsHistoryLimit: 3 EOF $ oc create -f image-pruner.yaml Actual results: The ImagePruner "imageprunertest" is invalid: spec.keepYoungerThan: Invalid value: "string": spec.keepYoungerThan in body must be of type integer: "string" Expected results: The object to be created without problem Additional info:
Below error still return when define like "keepYoungerThan: 60m" with 4.5.0-0.nightly-2020-05-27-174108: # imagepruners.imageregistry.operator.openshift.io "cluster" was not valid: # * spec.keepYoungerThan: Invalid value: "string": spec.keepYoungerThan in body must be of type integer: "string" Below setting can be saved: spec: failedJobsHistoryLimit: 3 keepTagRevisions: 3 keepYoungerThan: 60 schedule: "" successfulJobsHistoryLimit: 3 suspend: false
This config change works: spec: failedJobsHistoryLimit: 3 keepTagRevisions: 3 keepYoungerThan: 60 keepYoungerThanDuration: 60m I will report a doc bug to deprecate "keepYoungerThan".
If keepYoungerThan is deprecated, can we pop up a warning let user know to use keepYoungerThanDuration when user wants to config keepYoungerThan?
Unfortunately we cannot change the type of keepYoungerThan from an integer to string. We should replace keepYoungerThan with keepYoungerThanDuration in docs. It's better to almost completely remove keepYoungerThan from documentation, we can just mention that this field exists and shouldn't be used.
(In reply to Oleg Bulatov from comment #8) > Unfortunately we cannot change the type of keepYoungerThan from an integer > to string. > > We should replace keepYoungerThan with keepYoungerThanDuration in docs. It's > better to almost completely remove keepYoungerThan from documentation, we > can just mention that this field exists and shouldn't be used. OK, get it, thanks! I will add your suggestion to the doc bug: https://bugzilla.redhat.com/show_bug.cgi?id=1840973 . Feel free to change this bug back to ON_QA.
Verified on 4.5.0-0.nightly-2020-05-29-005153.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409