Skip to content

Add x-onyxia instruction: oneAmong #1081

Description

@garronej

The idea is to let chart authors say "this must be filled up with one object among a given array of the XOnyxia context".

- relativePath: ide/s3-single.json
  content: |
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "profileName": {
          "type": "string",
          "x-onyxia": {
            "overwriteDefaultWith": "{{profileName}}"
          }
        },
        "accessKeyId": {
          "type": "string",
          "x-onyxia": {
            "overwriteDefaultWith": "{{AWS_ACCESS_KEY_ID}}"
          }
        },
        "secretAccessKey": {
          "type": "string",
          "x-onyxia": {
            "overwriteDefaultWith": "{{AWS_SECRET_ACCESS_KEY}}"
          }
        }
      },
      "x-onyxia": {
        "oneAmong": {
            options: "{{s3_array}}",
            defaultOption: "index===0"
            // OR defaultOption: "{{profileName}}==='default'"
           //  OR defaultOption: null
      }
    }

XOnyxia

{
    // ...
    "s3_array": [
        {
            "profileName": "default",
            "AWS_ACCESS_KEY_ID": "aaa",
            "AWS_SECRET_ACCESS_KEY": "bbb"
        },
        {
            "profileName": "myprofile",
            "AWS_ACCESS_KEY_ID": "ccc",
            "AWS_SECRET_ACCESS_KEY": "ddd"
        }
    ]
}
Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions