更新时间:2022-09-16 GMT+08:00
分享

基础控件

OSC console依据crd.yaml文件可以自动生成Operator的创建表单。crd.yaml文件中的properties(openAPIV3Schema.properties.spec.properties)对象会自动映射到对应的UI组件。

目前提供的基础类型控件分别有string、number、boolean、object、array类型。

string控件

一般场景的文本输入,支持校验规则的配置。

配置示例:

type: string
title: Extra RabbitMQ Configuration
description: Extra configuration to be appended to...
图1 string控件

number控件

一般场景的数字输入,支持设置数值的大小范围。

配置示例:

type: number
title: Number of replicas
description: Number of replicas to deploy
图2 number控件

boolean控件

boolean类型字段输入。

配置示例:

type: boolean
title: Enable Init Containers
description: Use an init container to set required...
图3 boolean控件

object控件

结构体格式输入,支持子控件的嵌套。

配置示例:

type: object
title: Presistence configuration
properties:
  enablePersistence:
    type: boolean
    title: Enable Persistence
    description: Enable persistence using Persistent Volume Claims
  persistentVolumeSize:
    type: string
    title: Persistent Volume Size
    description:
图4 object控件

array类型

满足数组类型的输入,支持设置最多项最少项等。

配置示例:

type: array
title: env
description: The DataDog ...
items:
  properties: 
    name: 
      type: string
      title: name
      description: Name of ...
    persistentVolumeSize: 
      type: string
      title: Persistent Volume Size
      description: 
    valueFrom:
      type: object
      properties:
        ...
图5 array类型
分享:

    相关文档

    相关产品