You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
544 B
Go
23 lines
544 B
Go
package pb
|
|
|
|
import (
|
|
"github.com/moby/buildkit/session"
|
|
"github.com/moby/buildkit/session/secrets/secretsprovider"
|
|
)
|
|
|
|
func CreateSecrets(secrets []*Secret) (session.Attachable, error) {
|
|
fs := make([]secretsprovider.Source, 0, len(secrets))
|
|
for _, secret := range secrets {
|
|
fs = append(fs, secretsprovider.Source{
|
|
ID: secret.ID,
|
|
FilePath: secret.FilePath,
|
|
Env: secret.Env,
|
|
})
|
|
}
|
|
store, err := secretsprovider.NewStore(fs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return secretsprovider.NewSecretProvider(store), nil
|
|
}
|