Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool for Generating Trigger Schema #6345

Open
SpiritZhou opened this issue Nov 19, 2024 · 1 comment
Open

Tool for Generating Trigger Schema #6345

SpiritZhou opened this issue Nov 19, 2024 · 1 comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@SpiritZhou
Copy link
Contributor

Proposal

Generating trigger metadata schema according to new declarative scaler configuration, which can be used for validation or other related improvement.

Input:
make generate-trigger-metadata-schema [--triggername][--output][--outputfile]

Output:
trigger-metadata-schemas.yaml

Trigger metadata example:

- type: kubernetes-workload
  metadatafields:
    activationValue:
        type: string
        default: "0"
    podSelector:
        type: string
    value:
        type: string
        default: "0"
- type: activemq
  metadatafields:
    activationTargetQueueSize:
      type: string
      optional: "true"
      default: "0"
    brokerName:
      type: string
      optional: "true"
    corsHeader:
      type: string
      optional: "true"
    destinationName:
      type: string
      optional: "true"
    managementEndpoint:
      type: string
      optional: "true"
    password:
      type: string
    passwordFromEnv:
      type: string
    restAPITemplate:
      type: string
      optional: "true"
    targetQueueSize:
      type: string
      optional: "true"
      default: "10"
    username:
      type: string
    usernameFromEnv:
      type: string

Use-Case

No response

Is this a feature you are interested in implementing yourself?

Yes

Anything else?

No response

@SpiritZhou SpiritZhou added needs-discussion feature-request All issues for new features that have not been committed to labels Nov 19, 2024
@wozniakjan
Copy link
Member

the tricky part is that technically all metadata fields are string in the CRD definition despite the underlying type. The OpenAPI schema allows setting multiple types for a field, maybe we can leverage that in some way?
https://stackoverflow.com/questions/46472543/specifying-multiple-types-for-additionalproperties-through-swagger-openapi

We would likely need to change the map[string]string to map[string]any but this theoretically shouldn't be a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Projects
Status: To Triage
Development

No branches or pull requests

2 participants