todaygood / openshift-lab

lab on openshift
0 stars 0 forks source link

Error: only encoded map or array can be decoded into a struct #9

Open todaygood opened 6 years ago

todaygood commented 6 years ago

Issue

[root@ose0 ~]# oc create -f bwa2.yml 
Error from server (BadRequest): error when creating "bwa2.yml": Pod in version "v1" cannot be handled as a Pod: only encoded map or array can be decoded into a struct[root@ose0 ~]# 
[root@ose0 ~]# 
[root@ose0 ~]# cat bwa2.yml 
apiVersion: v1
kind: Pod
metadata:
  name: bwa1
spec:
  restartPolicy: OnFailure
  volumes:
  - name: bwa-data
    persistentVolumeClaim: data-pvc
  containers:
  - name: bwa-bio
    workingDir: /data
    image: biocontainers/bwa
    command: ["bwa"]
    args: ["index","Homo_sapiens.GRCh38.dna.chromosome.16.fa"]
    volumeMounts:
    - name: bwa-data
      mountPath: /data

其实是 persistentVolumeClaim的写法有问题,参见: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#persistentvolumeclaimvolumesource-v1-core

persistentVolumeClaim: 
    claimName: data-pvc
todaygood commented 6 years ago

https://github.com/openshift/origin/issues/10171