码迷,mamicode.com
首页 > 其他好文 > 详细

Validation fails for CustomResource with array of pointers

时间:2021-01-20 12:18:15      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:items   ref   png   res   描述   meta   文件   也有   没有   

github上面的原问题链接:https://github.com/kubernetes/kubernetes/issues/98079
按照他说的,
技术图片
我新建了一个crd,yaml文件内容如下:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: resous.getnull.example.com
spec:
  group: getnull.example.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                allocations:
                  items:
                    nullable: true
                    type: integer
                  type: array
  scope: Namespaced
  names:
    plural: resous
    singular: resou
    kind: Resou

执行 kubectl describe crd resous.getnull.example.com
技术图片
新创建的crd里面确实包含他说的属性,然后按照他说的使用 edit 命令,什么都不修改,直接保存,会报一个错误:
ValidationError(IPAMBlock.spec.allocations): unknown object type "nil" in IPAMBlock.spec.allocations[3]
但是我执行的时候没有遇到什么问题。我还是觉得他描述的比较模糊,没太懂他的意思,也有可能是他使用的1.18版本,而我是用的是1.20版本,所以没能复现。

Validation fails for CustomResource with array of pointers

标签:items   ref   png   res   描述   meta   文件   也有   没有   

原文地址:https://www.cnblogs.com/codenoob/p/14301430.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!