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

feat: allow URL and local files for Store locations #985

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LucasRoesler
Copy link
Member

Description

Enable local files and remote files over HTTP(S) as store locations for the Function and Template stores.

This enables the following commands to work as expected

faas-cli store list --url $HOME/Downloads/functions.json
faas-cli store list --url ~/Downloads/functions.json
faas-cli store list --url https://internal/organization.com/openfaas/functions.json
faas-cli template store list --url $HOME/Downloads/templates.json
faas-cli template store list --url ~/Downloads/templates.json
faas-cli template store list --url
https://internal.organization.com/openfaas/templates.json

Additional locations such as ipfs, blob storage (s3, Google Cloud Storge, etc) and other could also be supported via a small patch to the ReadJSON implementation.

Motivation and Context

  • I have raised an issue to propose this change (required)

Resolves #984

How Has This Been Tested?

Using modified versions of the store files, I was able to list templates and functions from my Downloads folder

$ faas-cli template store list --url $HOME/Downloads/templates.json

NAME       RECOMMENDED DESCRIPTION SOURCE
dockerfile [x]         openfaas    Classic Dockerfile template

$ faas-cli store list --url=$HOME/Downloads/functions.json

FUNCTION AUTHOR   DESCRIPTION
nodeinfo openfaas NodeInfo

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Enable local files and remote files over HTTP(S) as store locations for
the Function and Template stores.

This enables the following commands to work as expected

```sh
faas-cli store list --url $HOME/Downloads/functions.json
faas-cli store list --url ~/Downloads/functions.json
faas-cli store list --url https://internal/organization.com/openfaas/functions.json
faas-cli template store list --url $HOME/Downloads/templates.json
faas-cli template store list --url ~/Downloads/templates.json
faas-cli template store list --url
https://internal.organization.com/openfaas/templates.json
```

Additional locations such as ipfs, blob storage (s3, Google Cloud Storge, etc)
and other could also be supported via a small patch to the
`ReadJSON` implementation.

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify a local file on disk for the function store
1 participant