Bug 1976112

Summary: batch/v1beta1 CronJob warning appears in image pruner pod when image registry is removed
Product: OpenShift Container Platform Reporter: Wenjing Zheng <wzheng>
Component: Image RegistryAssignee: Nichita Gutu <ngutu>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.8CC: aos-bugs, obulatov, wewang, xiuwang
Target Milestone: ---Keywords: TestCaseNeeded
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: spec.managementState in configs.imageregistry is set to Removed. Consequence: Image pruner pod generates warnings about deprecated CronJob in v1.21+ and that batch/v1 should be used. Fix: Updated batch/v1beta1 with batch/v1 in openshift/oc. Result: Warnings about deprecated CronJob in image pruner pods no longer appear.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:36:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wenjing Zheng 2021-06-25 08:48:22 UTC
Description of problem:
Below warning appears in image pruner pod when image registry is removed:
$ oc logs pods/image-pruner-27076840-79qkw 
W0625 08:40:02.621430       1 warnings.go:70] batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob
I0625 08:40:02.860125       1 prune.go:348] Creating image pruner with keepYoungerThan=1h0m0s, keepTagRevisions=3, pruneOverSizeLimit=<nil>, allImages=true
Only API objects will be removed.  No modifications to the image registry will be made.
Summary: deleted 0 objects


Version-Release number of selected component (if applicable):
4.8.0-0.nightly-2021-06-24-101028

How reproducible:
always

Steps to Reproduce:
1.Set spec.managementState to Removed in configs.imageregistry
2.Check the log in image pruner pod
3.

Actual results:
Below warning appears: W0625 08:40:02.621430       1 warnings.go:70] batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob

Expected results:
The warning should be removed

Additional info:

Comment 3 Wenjing Zheng 2021-07-15 03:18:24 UTC
Verified on 4.9.0-0.nightly-2021-07-14-204159
$ ./oc logs pods/image-pruner-27105317-m4j94
I0715 03:17:02.680478       1 prune.go:347] Creating image pruner with keepYoungerThan=1h0m0s, keepTagRevisions=3, pruneOverSizeLimit=<nil>, allImages=true
Summary: deleted 0 objects

Comment 4 wewang 2021-08-17 08:33:28 UTC
Case added.

Comment 7 errata-xmlrpc 2021-10-18 17:36:51 UTC
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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), 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/RHSA-2021:3759