score-spec / score-go

Reference library for parsing and loading Score files
Apache License 2.0
26 stars 6 forks source link

feat: added common uriget package for fetching provisioners #45

Closed astromechza closed 2 months ago

astromechza commented 2 months ago

I'd like to add a flag to the score-compose and score-k8s init subcommands for loading external provisioner files. This should mean that the user no longer needs to access the .score-xyz state directory themselves since this can be considered internal behavior.

We want to be able to pull in provisioners from the local filesystem, git, or http, so this uriget package supports this and provides an interface for reading files in this way. The git support calls the git binary on the system. This avoids needing a built in heavyweight client library and means we can take advantage of any auth sockets or global config.

Examples:

score-compose init \
    --provisioners https://raw.githubusercontent.com/user/repo/public-provisioner/provisioners.yaml \
    --provisioners custom-provisioners.yaml \
    --provisioners git-ssh://git@github.com/score-spec/score-compose-provisioners/example.yaml
astromechza commented 2 months ago

Great! Enriching the Developer experience and workflow to get external provisioners.

Answering this need: score-spec/score-compose#141.

What about supporting OCI image? opencontainers.org I can do for example oras push|pull with the provisioners.

Maybe later, this library at least creates a place where that would go.