Portainer icon

Portainer

Interact with Portainer via API

Actions190

Gitops → Git Operation Repo File Preview

AI-generated

Overview

This node performs a Git operation to preview a file in a Git repository within a GitOps context. It is useful when you want to fetch and inspect the contents of a file from a Git repository without cloning or manually accessing the repository. Typical use cases include validating configuration files, templates, or manifests stored in Git before applying them to infrastructure or deployments.

For example, you might use this node to preview a Kubernetes manifest file stored in a Git repository to ensure it has the correct configuration before triggering a deployment pipeline.

Properties

Name Meaning
Body Template details as a string. This property contains the content or parameters related to the file preview operation.

Output

The node outputs JSON data representing the previewed file's content or metadata retrieved from the Git repository. The exact structure depends on the API response but generally includes the file content or a rendered template preview.

If the node supports binary data output (not explicitly shown here), it would typically represent the raw file content or an artifact related to the file preview.

Dependencies

  • Requires an API key credential for authenticating with the GitOps service.
  • Depends on the external GitOps API endpoint configured via credentials.
  • Uses an OpenAPI specification internally to define operations and requests.

Troubleshooting

  • Common issues:

    • Authentication failures due to invalid or missing API credentials.
    • Incorrect or malformed "Body" input causing the API to reject the request.
    • Network connectivity problems preventing access to the GitOps API.
  • Error messages:

    • Authorization errors: Verify that the API key credential is correctly set up and has sufficient permissions.
    • Validation errors on the "Body" field: Ensure the input string matches the expected template format required by the GitOps API.
    • Timeout or connection errors: Check network settings and API endpoint availability.

Links and References

  • Refer to your GitOps provider’s API documentation for details on the file preview operation.
  • n8n documentation on creating custom nodes and using API credentials.

Discussion