mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 16:35:44 +03:00
* exec: add a client.users configuration block For now just add min/max dynamic user values; soon we can also absorb the "user.denylist" and "user.checked_drivers" options from the deprecated client.options map. * give the no-op pool implementation a better name * use explicit error types to make referencing them cleaner in tests * use import alias to not shadow package name
33 lines
785 B
Go
33 lines
785 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package config
|
|
|
|
import sconfig "github.com/hashicorp/nomad/nomad/structs/config"
|
|
|
|
// UsersConfig configures things related to operating system users.
|
|
type UsersConfig struct {
|
|
// MinDynamicUser is the lowest uid/gid for use in the dynamic users pool.
|
|
MinDynamicUser int
|
|
|
|
// MaxDynamicUser is the highest uid/gid for use in the dynamic users pool.
|
|
MaxDynamicUser int
|
|
}
|
|
|
|
func UsersConfigFromAgent(c *sconfig.UsersConfig) *UsersConfig {
|
|
return &UsersConfig{
|
|
MinDynamicUser: *c.MinDynamicUser,
|
|
MaxDynamicUser: *c.MaxDynamicUser,
|
|
}
|
|
}
|
|
|
|
func (u *UsersConfig) Copy() *UsersConfig {
|
|
if u == nil {
|
|
return nil
|
|
}
|
|
return &UsersConfig{
|
|
MinDynamicUser: u.MinDynamicUser,
|
|
MaxDynamicUser: u.MaxDynamicUser,
|
|
}
|
|
}
|