Description of problem: the cronjob object is using the old apiversion when its created via the openshift console Version-Release number of selected component (if applicable): 4.8.33 How reproducible: always Steps to Reproduce: 1. create a cronjob object yaml with batch/v1 as the apiVersion 2. apply the cronjob via the opensfhit console 3. notice the change in the apiversion from batch/v1 to batch/v1beta1 Actual results: The api version is changed from batch/v1 to batch/v1beta1 Expected results: Since the api version batch/v1beta1 is no longer supported in ocp 4.8 the api version should be batch/v1 even in the openshift console. Additional info: when getting the object via the CLI the api version is correct however the problem is with the console, it seems that the console is using a template where the batch/v1beta1 is hardcoded [1] [1] https://github.com/openshift/console/blob/release-4.8/frontend/public/models/yaml-templates.ts#L272-L289
*** Bug 2067013 has been marked as a duplicate of this bug. ***
*** Bug 2069539 has been marked as a duplicate of this bug. ***
Hi jhadvig Could you help to confirm if currently console is allow user to create CronJob with apiversion batch/v1beta1 If yes, could you help to check below scenario, which is a URL would be navigated to /batch~v1beta1~CronJob/XXX page that is incorrect (A .gif file is added on attachment for more details) Additional Info: This issue is only happened when user go back to 'CronJobs' page by using breadcrumb navigation menu after create a CronJob with 'v1beta1' apiversion Reproduce step: 1. Login to OCP and navigate to developer perspective 2. Navigate to Search page, choose 'CronJob' on the dropdown list of 'Resources', and click 'add to navigation' 3. Navigate to 'CronJobs' page, create cronjobs with below YAML apiVersion: batch/v1beta1 kind: CronJob metadata: name: example spec: schedule: '@daily' jobTemplate: spec: template: spec: containers: - name: hello image: busybox args: - /bin/sh - '-c' - date; echo Hello from the Kubernetes cluster restartPolicy: OnFailure 4. On the created CronJob details page -> YAML Tab, check the apiversion for the YAML 5. Go back to CronJobs page by using the navigation bar 6. Click 'Create CronJob' again 7. Check the YAML file that shown on create CronJob page 8. Check the existing CronJob that with apiversion 'batch/v1' Actual Result: 4. CronJob can be created successfully with apiversion 'batch/v1beta1' 5. The navigation URL for 'CronJobs' is redirect to https://<my console>/k8s/ns/<namespace>/batch~v1beta1~CronJob 7. The sample YAML file is incorrect with below format: apiVersion: batch/v1beta1 kind: CronJob metadata: name: example namespace: test spec: {} 8. The existing CronJob apiversion will change to 'batch/1beta1' which is incorrect Expected Result: 4. 'batch/v1beta1' should replace with 'batch/v1' automatically when user create CronJob with 'v1beta1' on the created cronjob page 5. The navigation URL of https://<my console>/k8s/ns/<namespace>/batch~v1beta1~CronJob should not exist 7. The sample YAML file should as same as the one on administrator perspective 8. The change should not impact other CronJob
@xiyuzhao@redhat.com, I opened https://github.com/openshift/console/pull/11662 to address the problem noted in https://bugzilla.redhat.com/show_bug.cgi?id=2065840#c7.
This bug has been verified on payload 4.11.0-0.nightly-2022-06-11-054027 Verification Step: 1. Login OCP as administrator 2. Create a cronjob object YAML with batch/v1 as the apiVersion at Administrator and developer perspective, and apply the cronjob via the OpenShift console 3. Notice the change in the API version from batch/v1 to batch/v1beta1 Result: 3. The default API version for CronJob is batch/v1. If a user provides the old API version like batch/v1beta1, UI will automatically update the YAML to batch/v1 after creating
Given its severity of `medium` and the fact that Version is 4.8, which is in maintenance support, I dont think we should backport the issue all the way down to 4.8. During the Maintenance Support phase, qualified Critical and Important Security Advisories (RHSAs) and Urgent and Selected High Priority Bug Fix Advisories (RHBAs) may be backported.
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 (Important: OpenShift Container Platform 4.11.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-2022:5069