Bug 1503601 - `oc apply view-last-applied` shows confusing "MISSING" in yaml/json output
Summary: `oc apply view-last-applied` shows confusing "MISSING" in yaml/json output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.8.0
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-18 13:09 UTC by Xingxing Xia
Modified: 2018-03-28 14:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-28 14:08:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 None None None 2018-03-28 14:08:33 UTC

Description Xingxing Xia 2017-10-18 13:09:25 UTC
Description of problem:
`oc apply view-last-applied` shows confusing "MISSING" in yaml/json output

Version-Release number of selected component (if applicable):
First found in oc/openshift v3.7.0-0.159.0
Double confirmed occurrence in oc/openshift v3.6.173.0.52

How reproducible:
Always

Steps to Reproduce:
1. Create DC
$ oc run hello --image=openshift/hello-openshift

2. Wait app pod becomes Running, then prepare DC yaml for following `oc apply`
$ oc export dc hello > mydc.yaml
$ vi mydc.yaml # do some edit and save, e.g. add one label key/value pair
metadata:
...
  labels:
    run: hello
    label1: value1 # this is the edit
  name: hello
...

3. Run `oc apply`
$ oc apply -f mydc.yaml

4. Then run
$ oc apply view-last-applied dc/hello

Actual results:
3. Cmd succeeds with message '... deploymentconfig "hello" configured'
4. It shows confusing 2 "MISSING"s and 2 '25%!'s in the yaml output (in `-o json` output, too).
This output is invalid yaml. Save it in a file, the file cannot be used in `oc create -f`
$ oc apply view-last-applied dc/hello
apiVersion: v1
kind: DeploymentConfig
metadata:
  annotations: {}
  creationTimestamp: null
  generation: 1
  labels:
    label1: value1
    run: hello
  name: hello
  namespace: xxia-proj
spec:
  replicas: 1
  selector:
    run: hello
  strategy:
    activeDeadlineSeconds: 21600
    resources: {}
    rollingParams:
      intervalSeconds: 1
      maxSurge: 25%!
(MISSING)      maxUnavailable: 25%!
(MISSING)      timeoutSeconds: 600
      updatePeriodSeconds: 1
    type: Rolling
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: hello
    spec:
      containers:
      - image: openshift/hello-openshift
        imagePullPolicy: Always
        name: hello
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
  test: false
  triggers:
  - type: ConfigChange
status:
  availableReplicas: 0
  latestVersion: 0
  observedGeneration: 0
  replicas: 0
  unavailableReplicas: 0
  updatedReplicas: 0

Expected results:
4. The output should be valid yaml without confusing "Missing" and "25%!"

Additional info:

Comment 1 Juan Vallejo 2017-10-20 19:19:49 UTC
Fabiano, I can take this bug, if that's okay

Origin PR: https://github.com/openshift/origin/pull/16983

Comment 2 Xingxing Xia 2017-10-24 09:33:17 UTC
Verified in oc v3.7.0-0.176.0, now no confusing "Missing" and "25%!" in step 4

Comment 5 errata-xmlrpc 2018-03-28 14:08:09 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, 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-2018:0489


Note You need to log in before you can comment on or make changes to this bug.