Bug 1524379 - The output of `oc describe pv` contains uninterpreted golang code
Summary: The output of `oc describe pv` contains uninterpreted golang code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.8.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 3.9.0
Assignee: Jan Safranek
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-11 11:46 UTC by Jianwei Hou
Modified: 2018-03-28 14:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-28 14:14:24 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:14:59 UTC

Description Jianwei Hou 2017-12-11 11:46:51 UTC
Description of problem:
Provision a PV with vsphere cloud provider, then run oc describe pv, found the output contains a string '%v', 

Version-Release number of selected component (if applicable):
openshift v3.8.18
kubernetes v1.8.1+0d5291c

How reproducible:
Always

Steps to Reproduce:
1. Create StorageClass without a StoragePolicyName.
2. Create PVC
3. oc describe pv

Actual results:
oc describe pv
Name:            pvc-8b71b882-de49-11e7-942f-0050569fcae9
Labels:          <none>
Annotations:     kubernetes.io/createdby=vsphere-volume-dynamic-provisioner
                 pv.kubernetes.io/bound-by-controller=yes
                 pv.kubernetes.io/provisioned-by=kubernetes.io/vsphere-volume
StorageClass:    vsphere
Status:          Bound
Claim:           jhou/c1
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Message:         
Source:
    Type:        vSphereVolume (a Persistent Disk resource in vSphere)
    VolumePath:      StoragePolicyName:  %v

    FSType:                            [datastore1] kubevols/kubernetes-dynamic-pvc-8b71b882-de49-11e7-942f-0050569fcae9.vmdk
%!(EXTRA string=ext4, string=)Events:  <none>


Expected results:
String '%v' does not appear in the output.


PV Dump:
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    kubernetes.io/createdby: vsphere-volume-dynamic-provisioner
    pv.kubernetes.io/bound-by-controller: "yes"
    pv.kubernetes.io/provisioned-by: kubernetes.io/vsphere-volume
  creationTimestamp: 2017-12-11T11:29:17Z
  name: pvc-8b71b882-de49-11e7-942f-0050569fcae9
  resourceVersion: "696372"
  selfLink: /api/v1/persistentvolumes/pvc-8b71b882-de49-11e7-942f-0050569fcae9
  uid: 85cf1729-de66-11e7-942f-0050569fcae9
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: c1
    namespace: jhou
    resourceVersion: "696363"
    uid: 8b71b882-de49-11e7-942f-0050569fcae9
  mountOptions:
  - ro
  persistentVolumeReclaimPolicy: Delete
  storageClassName: vsphere
  vsphereVolume:
    fsType: ext4
    volumePath: '[datastore1] kubevols/kubernetes-dynamic-pvc-8b71b882-de49-11e7-942f-0050569fcae9.vmdk'
status:
  phase: Bound


PVC Dump:
{
  "kind": "PersistentVolumeClaim",
  "apiVersion": "v1",
  "metadata": {
    "name": "c1",
    "annotations": {
        "volume.beta.kubernetes.io/storage-class": "vsphere"
    }
  },
  "spec": {
    "accessModes": [
      "ReadWriteOnce"
    ],
    "resources": {
      "requests": {
        "storage": "1Gi"
      }
    }
  }
}

StorageClass Dump (if StorageClass used by PV/PVC):
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: vsphere
provisioner: kubernetes.io/vsphere-volume
mountOptions:
  - "ro"

Additional info:

Comment 1 Jan Safranek 2018-03-02 15:20:40 UTC
It's already fixed upstream: https://github.com/kubernetes/kubernetes/pull/57202 

It's so trivial fix that I dare to port it back to 1.10 and 1.9:
https://github.com/openshift/origin/pull/18810

Comment 2 Jan Safranek 2018-03-06 08:49:58 UTC
1.9 PR: https://github.com/openshift/origin/pull/18853

Comment 4 Jianwei Hou 2018-03-13 02:51:46 UTC
Verified in v3.9.7 

# oc describe pv pvc-a2506afa-25df-11e8-a981-0050569f5abb
Name:            pvc-a2506afa-25df-11e8-a981-0050569f5abb
Labels:          <none>
Annotations:     kubernetes.io/createdby=vsphere-volume-dynamic-provisioner
                 pv.kubernetes.io/bound-by-controller=yes
                 pv.kubernetes.io/provisioned-by=kubernetes.io/vsphere-volume
StorageClass:    vspheredefault
Status:          Bound
Claim:           jhou/vspherec
Reclaim Policy:  Delete
Access Modes:    RWO
VolumeMode:      Filesystem
Capacity:        1Gi
Message:         
Source:
    Type:               vSphereVolume (a Persistent Disk resource in vSphere)
    VolumePath:         [datastore1] kubevols/kubernetes-dynamic-pvc-a2506afa-25df-11e8-a981-0050569f5abb.vmdk
    FSType:             ext4
    StoragePolicyName:  
Events:                 <none>

Comment 7 errata-xmlrpc 2018-03-28 14:14:24 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.