Skip to content

Expose datasource variables __DS_PATH__ and __DS_NAME__ to exec command configuration #262

@Andor

Description

@Andor

Example for kinda universal helm-template datasource:

qbec.yaml:

  vars:
    computed:
      - name: helm-template
        code: |
          {
            local p = import './params.libsonnet').components[
              std.extVar('qbec.io/__DS_NAME__')
            ],
            command: 'helm',
            args: ['template', ('https://' + std.extVar('qbec.io/__DS_PATH__')), '-n', p.namespace, '-f-'],
            stdin: std.manifestJson(p.values)
          }
  dataSources:
    - exec://victoriametrics/helm-template

components/victoriametrics.jsonnet:

local vm = importstr 'data://victoriametrics/github.com/VictoriaMetrics/helm-charts/raw/347d4558d9c25cd341718bf5a2ee167da042c080/packages/victoria-metrics-cluster-0.9.6.tgz';
if std.objectHas(params, 'enabled') && params.enabled then std.native('parseYaml')(vm)

environments/test.jsonnet:

...
    victoriametrics+: {
      enabled: true,
      namespace: 'victoriametrics',
      values: {
        vmstorage: {
          retentionPeriod: 4,  // 4 months
          persistentVolume: {
            size: '32Gi',
          },
        },
      },
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions