-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable containersV2
by default
#369
Conversation
Generate changelog in
|
wip: Make containerV2 default to true wip: Make containerV2 default to true wip: re-add containerv2 flag to test configs. add debug logs remove more containerV2 flags try omitempty use setToDefaults outparamcheck use field.Addr().Interface() pass addr of conf don't take addr of unaddressable value use *bool set default update config_test set containerv2: false for existing configs nil check update test expectation Remove debug logs. Add nl
7161e99
to
4f135ba
Compare
@@ -144,7 +144,7 @@ func TestMainMethodWithoutCustomConfig(t *testing.T) { | |||
} | |||
|
|||
func TestMainMethodContainerWithoutCustomConfig(t *testing.T) { | |||
output := testContainerSupportEnabled(t, "foo", "-XX\\:InitialRAMPercentage=75.0 -XX\\:MaxRAMPercentage=75.0 -XX\\:ActiveProcessorCount=2", []string{}) | |||
output := testContainerSupportEnabled(t, "foo", "", []string{"-Xmx", "-Xms"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a no custom config, or there is a failure to read the custom config, we use the new default behavior, hence this change.
@@ -3,3 +3,5 @@ configVersion: 1 | |||
jvmOpts: | |||
- '-Xmx1g' | |||
dangerousDisableContainerSupport: true | |||
experimental: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the flag to false
to retain tests for old behavior for now.
@@ -267,6 +267,10 @@ func parseCustomConfig(yamlString []byte) (PrimaryCustomLauncherConfig, error) { | |||
"subProcess config %s", name) | |||
} | |||
} | |||
if config.Experimental.ContainerV2 == nil { | |||
var trueVal = true | |||
config.Experimental.ContainerV2 = &trueVal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this pattern elsewhere, but it would be nice if I could make this one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's anything in the standard library for it :( but there are some pretty small deps for doing something like this:
package main
import (
"fmt"
"k8s.io/utils/ptr"
)
func main() {
a := ptr.To(false)
fmt.Printf("%T %v", a, *a)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I'm leaning towards not adding the dep since we use this in one place in the implementation (and also once in the tests).
Thanks @mpritham and @andybradshaw! 👍 |
Released 1.101.0 |
Before this PR
In #361 we introduced the
containersV2
flag. After observing improvements across several stacks, we'd like to enable the functionality guarded by the flag as the default behavior. We'd like to keep the option open for devs to disable the behavior if needed, by setting thecontainersV2
flag tofalse
.After this PR
==COMMIT_MSG==
Enable
containersV2
by default.==COMMIT_MSG==
Possible downsides?
N/A.