runtime: provide credentials to services (#1817)
* runtime: inject credentials into service * util/auth: self generate accounts (needed for jwt) * runtime/kubernetes: add logging for creds * runtime/kubernetes: serialize secret name * runtime/kubernetes: remove unused code * runtime/kubernetes: base64 encode secret * runtime/kubernetes: remove metadata from secret * util/kubernetes/client: omit empty secret metadata * util/kubernetes/client: fix secret template * util/kubernetes/client: fix secrets * web: update auth util * util/auth: fix missing arg * extend token expiry * extend token expiry
This commit is contained in:
@@ -82,6 +82,8 @@ type CreateOptions struct {
|
||||
Namespace string
|
||||
// Specify the context to use
|
||||
Context context.Context
|
||||
// Credentials for the service to use
|
||||
Credentials string
|
||||
}
|
||||
|
||||
// ReadOptions queries runtime services
|
||||
@@ -126,6 +128,13 @@ func CreateContext(ctx context.Context) CreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// CreateCredentials sets the credentials to start the service with
|
||||
func CreateCredentials(user, pass string) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
o.Credentials = user + ":" + pass
|
||||
}
|
||||
}
|
||||
|
||||
// WithCommand specifies the command to execute
|
||||
func WithCommand(cmd ...string) CreateOption {
|
||||
return func(o *CreateOptions) {
|
||||
|
Reference in New Issue
Block a user