Description of problem: When file based input is use with oc get --ignore-not-found, a missing resource will cause the command to return an incomplete list of extant resources. This behavior is different from using named resources on the command line. # This is the expected/correct output (2 existing / 1 missing resource) [ec2-user us-east-1 ~]$ oc get -n openshift-monitoring --ignore-not-found secrets/grafana-tls secrets/grafana-proxy-missing secrets/grafana-config NAME TYPE DATA AGE grafana-tls kubernetes.io/tls 2 51d NAME TYPE DATA AGE grafana-config Opaque 1 51d But when the resources to retrieve are provided in a file based input, only 1 resource is returned -- the missing resource apparently aborts the remainder of the search. >>search.yaml>>> apiVersion: v1 items: - apiVersion: v1 kind: Secret metadata: name: grafana-tls namespace: openshift-monitoring type: kubernetes.io/tls - apiVersion: v1 kind: Secret metadata: name: grafana-proxy-missing namespace: openshift-monitoring type: kubernetes.io/tls - apiVersion: v1 kind: Secret metadata: name: grafana-config namespace: openshift-monitoring type: kubernetes.io/tls kind: List metadata: resourceVersion: "" selfLink: "" <<<<<<<<<<<<<<<< # The search will return an incomplete list of existing resources. [ec2-user us-east-1 ~]$ oc get -f search.yaml --ignore-not-found NAME TYPE DATA AGE grafana-tls kubernetes.io/tls 2 51d Version-Release number of selected component (if applicable): v4.1.4 How reproducible: 100%
This is being fixed in https://github.com/kubernetes/kubernetes/pull/81452
Confirmed with latest oc client , the issue has fixed: [root@dhcp-140-138 ~]# oc get -n openshift-monitoring --ignore-not-found secrets/grafana-tls secrets/grafana-proxy-missing secrets/grafana-config NAME TYPE DATA AGE grafana-tls kubernetes.io/tls 2 4h10m NAME TYPE DATA AGE grafana-config Opaque 1 4h10m [root@dhcp-140-138 ~]# oc get -f search.yaml --ignore-not-found NAME TYPE DATA AGE grafana-tls kubernetes.io/tls 2 4h11m NAME TYPE DATA AGE grafana-config Opaque 1 4h11m [root@dhcp-140-138 linux]# oc version Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.15-201909041605+63712ea-dirty", GitCommit:"63712ea", GitTreeState:"dirty", BuildDate:"2019-09-04T23:58:30Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
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-2019:2681