mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: read-only root fs becomes default (#1019)
* fn: read-only root fs becomes default Set root fs as read-only by default. * fn: update doc for FN_DISABLE_READONLY_ROOTFS
This commit is contained in:
@@ -31,7 +31,7 @@ type AgentConfig struct {
|
||||
PreForkNetworks string `json:"pre_fork_networks"`
|
||||
EnableNBResourceTracker bool `json:"enable_nb_resource_tracker"`
|
||||
MaxTmpFsInodes uint64 `json:"max_tmpfs_inodes"`
|
||||
EnableReadOnlyRootFs bool `json:"enable_readonly_rootfs"`
|
||||
DisableReadOnlyRootFs bool `json:"disable_readonly_rootfs"`
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -56,14 +56,13 @@ const (
|
||||
EnvPreForkNetworks = "FN_EXPERIMENTAL_PREFORK_NETWORKS"
|
||||
EnvEnableNBResourceTracker = "FN_ENABLE_NB_RESOURCE_TRACKER"
|
||||
EnvMaxTmpFsInodes = "FN_MAX_TMPFS_INODES"
|
||||
EnvEnableReadOnlyRootFs = "FN_ENABLE_READONLY_ROOTFS"
|
||||
EnvDisableReadOnlyRootFs = "FN_DISABLE_READONLY_ROOTFS"
|
||||
|
||||
MaxDisabledMsecs = time.Duration(math.MaxInt64)
|
||||
|
||||
// defaults
|
||||
|
||||
DefaultHotPoll = 200 * time.Millisecond
|
||||
DefaultNBIOHotPoll = 20 * time.Millisecond
|
||||
DefaultHotPoll = 200 * time.Millisecond
|
||||
)
|
||||
|
||||
func NewAgentConfig() (*AgentConfig, error) {
|
||||
@@ -106,9 +105,8 @@ func NewAgentConfig() (*AgentConfig, error) {
|
||||
if _, ok := os.LookupEnv(EnvEnableNBResourceTracker); ok {
|
||||
cfg.EnableNBResourceTracker = true
|
||||
}
|
||||
|
||||
if _, ok := os.LookupEnv(EnvEnableReadOnlyRootFs); ok {
|
||||
cfg.EnableReadOnlyRootFs = true
|
||||
if _, ok := os.LookupEnv(EnvDisableReadOnlyRootFs); ok {
|
||||
cfg.DisableReadOnlyRootFs = true
|
||||
}
|
||||
|
||||
if cfg.EjectIdle == time.Duration(0) {
|
||||
|
||||
Reference in New Issue
Block a user