runtime: support for dynamic secrets (#1861)
* runtime: replace CreateCredentials with CreateSecret * runtime/kubernetes: secrets support * runtime: CreateSecret => WithSecret * runtime: use map[string]string for secrets * runtime/kubernetes: update to use kv secrets * Fix merge conflict (missing import) Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
@@ -270,16 +270,9 @@ func (r *localRuntime) Create(s *runtime.Service, opts ...runtime.CreateOption)
|
||||
options.Args = []string{"run", "."}
|
||||
}
|
||||
|
||||
// pass credentials as env vars
|
||||
if len(options.Credentials) > 0 {
|
||||
// validate the creds
|
||||
comps := strings.Split(options.Credentials, ":")
|
||||
if len(comps) != 2 {
|
||||
return errors.New("Invalid credentials, expected format 'user:pass'")
|
||||
}
|
||||
|
||||
options.Env = append(options.Env, "MICRO_AUTH_ID", comps[0])
|
||||
options.Env = append(options.Env, "MICRO_AUTH_SECRET", comps[1])
|
||||
// pass secrets as env vars
|
||||
for key, value := range options.Secrets {
|
||||
options.Env = append(options.Env, key, value)
|
||||
}
|
||||
|
||||
if _, ok := r.namespaces[options.Namespace]; !ok {
|
||||
|
Reference in New Issue
Block a user