Skip to content

Commit

Permalink
refactor: switch default from opt-in to opt-out
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Spagnuolo <[email protected]>
  • Loading branch information
dylanspag-lmco committed Sep 17, 2024
1 parent 964d975 commit 8a7ece0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docs/deployment/configuration/generated/flyteadmin_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ k8s (`config.K8sPluginConfig`_)
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
create-container-config-error-grace-period: 0s
create-container-error-grace-period: 3m0s
default-annotations:
Expand Down Expand Up @@ -3041,7 +3041,7 @@ Co-Pilot Configuration
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
delete-resource-on-finalize (bool)
Expand Down Expand Up @@ -3386,7 +3386,7 @@ Used to enable SYS_PTRACE for co-pilot containers

.. code-block:: yaml
"false"
"true"
resource.Quantity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ k8s (`config.K8sPluginConfig`_)
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
create-container-config-error-grace-period: 0s
create-container-error-grace-period: 3m0s
default-annotations:
Expand Down Expand Up @@ -2522,7 +2522,7 @@ Co-Pilot Configuration
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
delete-resource-on-finalize (bool)
Expand Down Expand Up @@ -2867,7 +2867,7 @@ Used to enable SYS_PTRACE for co-pilot containers

.. code-block:: yaml
"false"
"true"
resource.Quantity
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment/configuration/generated/scheduler_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ k8s (`config.K8sPluginConfig`_)
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
create-container-config-error-grace-period: 0s
create-container-error-grace-period: 3m0s
default-annotations:
Expand Down Expand Up @@ -3041,7 +3041,7 @@ Co-Pilot Configuration
output-vol-name: flyte-outputs
start-timeout: 1m40s
storage: ""
add-sys-ptrace-capability: false
add-sys-ptrace-capability: true
delete-resource-on-finalize (bool)
Expand Down Expand Up @@ -3386,7 +3386,7 @@ Used to enable SYS_PTRACE for co-pilot containers

.. code-block:: yaml
"false"
"true"
resource.Quantity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
OutputVolumeName: "flyte-outputs",
CPU: "500m",
Memory: "128Mi",
AddSysPTraceCapability: false,
AddSysPTraceCapability: true,
StartTimeout: config2.Duration{
Duration: time.Second * 100,
},
Expand Down
12 changes: 6 additions & 6 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestFlyteCoPilotContainer(t *testing.T) {
},
CPU: "1024m",
Memory: "1024Mi",
AddSysPTraceCapability: false,
AddSysPTraceCapability: true,
}

t.Run("happy", func(t *testing.T) {
Expand All @@ -56,7 +56,7 @@ func TestFlyteCoPilotContainer(t *testing.T) {
assert.Equal(t, "/", c.WorkingDir)
assert.Equal(t, 2, len(c.Resources.Limits))
assert.Equal(t, 2, len(c.Resources.Requests))
assert.NotContains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
assert.Contains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
})

t.Run("happy stow backend", func(t *testing.T) {
Expand All @@ -74,7 +74,7 @@ func TestFlyteCoPilotContainer(t *testing.T) {
assert.Equal(t, "/", c.WorkingDir)
assert.Equal(t, 2, len(c.Resources.Limits))
assert.Equal(t, 2, len(c.Resources.Requests))
assert.NotContains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
assert.Contains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
})

t.Run("happy-vols", func(t *testing.T) {
Expand Down Expand Up @@ -111,12 +111,12 @@ func TestFlyteCoPilotContainer(t *testing.T) {
cfg.Memory = old
})

t.Run("sys-ptrace-add", func(t *testing.T) {
t.Run("no-sys-ptrace-add", func(t *testing.T) {
old := cfg.AddSysPTraceCapability
cfg.AddSysPTraceCapability = true
cfg.AddSysPTraceCapability = false
c, err := FlyteCoPilotContainer("x", cfg, []string{"hello"})
assert.NoError(t, err)
assert.Contains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
assert.NotContains(t, c.SecurityContext.Capabilities.Add, pTraceCapability)
cfg.AddSysPTraceCapability = old
})
}
Expand Down

0 comments on commit 8a7ece0

Please sign in to comment.