Bug 1820665
| Summary: | oc apply -f no longer applies as many resources as possible before exiting with an error. | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Marc Sluiter <msluiter> |
| Component: | oc | Assignee: | Maciej Szulik <maszulik> |
| Status: | CLOSED ERRATA | QA Contact: | zhou ying <yinzhou> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.5 | CC: | aos-bugs, fsimonce, jokerman, maszulik, mfojtik |
| Target Milestone: | --- | ||
| Target Release: | 4.5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-07-13 17:25:33 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1771572 | ||
|
Description
Marc Sluiter
2020-04-03 14:38:09 UTC
Is this a regression and 4.4 is not affected? Correct, this only affects 4.5 @Maciej: Is this something that is going to get fixed for 4.5? Or maybe it already was and the bug was not updated? We have a workaround in place so it does not affect us too badly, but it means we have to manually split all the yamls into separated objects first and then post them one by one. And that is ugly. Ok I did a test using a file that contained an undefined CR and then a namespace using the latest 4.5 ci version:
[msivak@localhost tmp]$ oc version
Client Version: 4.5.0-0.ci-2020-05-07-020439
Server Version: 4.5.0-0.ci-2020-05-07-020439
Kubernetes Version: v1.18.0-rc.1
[msivak@localhost tmp]$ cat test.yaml
---
apiVersion: performance.openshift.io/v1alpha1
kind: PerformanceProfile
metadata:
name: example-performanceprofile
spec:
cpu: "test"
---
apiVersion: v1
kind: Namespace
metadata:
labels:
openshift.io/cluster-monitoring: "true"
name: openshift-performance-addon
spec: {}
[msivak@localhost tmp]$ oc apply -f test.yaml
namespace/openshift-performance-addon created
error: unable to recognize "test.yaml": no matches for kind "PerformanceProfile" in version "performance.openshift.io/v1alpha1"
So it seems the bug is now resolved. I wonder if the patch was backported as it was only fixed in kubernetes v1.18.1
This was fixed in https://github.com/openshift/oc/pull/402 [root@dhcp-140-138 ~]# cat /tmp/bug.yaml
---
apiVersion: performance.openshift.io/v1alpha1
kind: PerformanceProfile
metadata:
name: example-performanceprofile
spec:
cpu: "test"
---
apiVersion: v1
kind: Namespace
metadata:
labels:
openshift.io/cluster-monitoring: "true"
name: openshift-performance-addon
spec: {}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "30 3 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:
- /bin/sh
- -c
- date; echo Hello from a CronJob
restartPolicy: OnFailure[root@dhcp-140-138 ~]# oc version
Client Version: 4.5.0-202005072157-f415627
Server Version: 4.5.0-0.nightly-2020-05-08-200452
Kubernetes Version: v1.18.0-rc.1
[root@dhcp-140-138 ~]# oc apply -f /tmp/bug.yaml
namespace/openshift-performance-addon unchanged
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
cronjob.batch/hello configured
error: unable to recognize "/tmp/bug.yaml": no matches for kind "PerformanceProfile" in version "performance.openshift.io/v1alpha1"
[root@dhcp-140-138 ~]# oc apply -f /tmp/bug.yaml namespace/openshift-performance-addon created cronjob.batch/hello created error: unable to recognize "/tmp/bug.yaml": no matches for kind "PerformanceProfile" in version "performance.openshift.io/v1alpha1" 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 |