Skip to content

Add e2e support for setting backend.id (Policy, Workflow, GraphQL) #624

@mszostok

Description

@mszostok

Description

Update Policy syntax and related logic according to the Delegated Storage proposal.

Syntax

  • Breaking change:

    Before After
    rules:
    - interface:
        path: cap.interface.database.postgresql.install
        revision: 0.1.0 # exact revision
      oneOf:
        - implementationConstraints:
            # (...)
    interface:
      rules:  # rules for Interfaces, now nested under `interface`
      - interface:
          path: cap.interface.database.postgresql.install
          revision: 0.1.0 # exact revision
        oneOf:
          - implementationConstraints:
              # (...)
  • Enhancements:

    • TypeInstances policy:
    # ...
    
    typeInstance:
      rules:
        - typeRef:
            path: "cap.type.aws.auth.credentials"
            revision: "0.1.0" # optional
          backend:
            id: "00fd161c-01bd-47a6-9872-47490e11f996" # Vault backend storage
        - typeRef:
            path: "cap.type.aws.*" # for any Type reference starting with such prefix
          backend:
            id: "31bb8355-10d7-49ce-a739-4554d8a40b63" # AWS secrets manager
        - typeRef:
            path: "cap.*" # Any other Type reference
          backend:
            id: a36ed738-dfe7-45ec-acd1-8e44e8db893b
            description: "Default Capact PostgreSQL backend"

    if capact-outputTypeInstances[*].backend not specified, check default from Policy.

    # default - static
    capact-outputTypeInstances:
      - name: mattermost-config
        from: additional
        # no backend definition -> use default storage backend

    During render:

    typeInstances:
    - alias: helm-release
      attributes: []
      createdBy: default/act-l49vh-30c7a078-6a77-475c-94dd-7466f56447ce
      typeRef:
        path: cap.type.helm.chart.release
        revision: 0.1.0
      value: null
      backend:
        id: 3ef2e4ac-9070-4093-a3ce-142139fd4a16 # helm-release backend - resolved UUID based on the injected TypeInstance
    interface:
      rules:
        - interface:
            path: cap.interface.database.postgresql.install 
          oneOf:
            - implementationConstraints:
                  # constraints to select Bitnami PostgreSQL installation, for example:
                  path: cap.implementation.bitnami.postgresql.install
              inject:
                requiredTypeInstances:
                  - id: b4cf15d2-79b1-45ee-9729-6b83289ecabc # Different TypeInstance of `cap.type.helm.storage` Type - it will be used instead of the one from `interface.rules.default.inject`
                    description: "Helm Release storage"         
    
      default: # properties applied to all rules above
        inject:
          requiredTypeInstances:
          - id: "3ef2e4ac-9070-4093-a3ce-142139fd4a16"
            description: "Helm storage (cap.type.helm.storage:0.1.0)"

AC

  • Add new properties
  • Handle storage TypeInstance injections
  • Update documentation

Extra scope:

  • update renderer logic
  • update local GraphQL schema
  • update engine GraphQL schema
  • update engine logic
  • update engine CRD
  • update Dashboard
  • set proper uses relations between storage backend TypeInstance and other TypeInstances

Related issues

See epic #604 for reason and use cases.

Metadata

Metadata

Assignees

Labels

area/cliRelates to CLIarea/documentationRelated to all activities around documentationarea/engineRelates to Enginearea/hubRelates to HubenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions