capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Validate parent nodes in manifests #621

Closed mszostok closed 2 years ago

mszostok commented 2 years ago

Description

Changes proposed in this pull request:

Testing

  1. Build CLI: make build-tool-cli

  2. Pick some Implementation manifest and add change requires property:

        cap.core.type.platform:
          oneOf:
            - name: kubernetes
              revision: 0.1.0
            - name: cap.type.platform.nomad
              revision: 0.1.0
            - name: cap.type.aws.auth.credentials
              revision: 0.1.0
  3. Execute validation against local manifests: NOTE: use the CLI from this PR

    capact manifest validate --server-side ./manifests/ --recursive

    you should see:

    Validating files in 5 concurrent jobs...
    - ✗ "manifests/implementation/mattermost/mattermost-team-edition/install.yaml":
        * RemoteImplementationValidator: Type cap.type.aws.auth.credentials is not attached to cap.core.type.platform abstract node
  4. Change additionalRefs in the cap.type.platform.cloud-foundry manifests from cap.core.type.platform to cap.core.type.platform.kubernetes

  5. Execute validation one more time to see error with wrong parent node:

    - ✗ "manifests/type/platform/cloud-foundry.yaml":
        * RemoteTypeValidator: cap.core.type.platform.kubernetes cannot be used as parent node as it resolves to concrete Type

Related issue(s)