-
Notifications
You must be signed in to change notification settings - Fork 301
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
kubernetes-exec is now a flag #2814
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import ( | |
"strings" | ||
"time" | ||
|
||
"github.com/buildkite/agent/v3/internal/experiments" | ||
"github.com/buildkite/agent/v3/logger" | ||
"github.com/buildkite/roko" | ||
"github.com/denisbrodbeck/machineid" | ||
|
@@ -78,7 +77,7 @@ type tagFetcher struct { | |
func (t *tagFetcher) Fetch(ctx context.Context, l logger.Logger, conf FetchTagsConfig) []string { | ||
tags := conf.Tags | ||
|
||
if experiments.IsEnabled(ctx, experiments.KubernetesExec) { | ||
if t.k8s != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this line right? the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, on one hand this is defensive in case we set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed it so that it used the same logic as before (only run |
||
k8sTags, err := t.k8s() | ||
if err != nil { | ||
l.Warn("Could not fetch tags from k8s: %s", err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,7 @@ type AgentStartConfig struct { | |
Experiments []string `cli:"experiment" normalize:"list"` | ||
Profile string `cli:"profile"` | ||
StrictSingleHooks bool `cli:"strict-single-hooks"` | ||
KuberentesExec bool `cli:"kubernetes-exec"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heads up there's a typo here Kuber There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol, whoops. i've just put a PR in to fix it, but there should be no impact |
||
|
||
// API config | ||
DebugHTTP bool `cli:"debug-http"` | ||
|
@@ -680,6 +681,7 @@ var AgentStartCommand = cli.Command{ | |
ProfileFlag, | ||
RedactedVars, | ||
StrictSingleHooksFlag, | ||
KubernetesExecFlag, | ||
|
||
// Deprecated flags which will be removed in v4 | ||
cli.StringSliceFlag{ | ||
|
@@ -955,6 +957,7 @@ var AgentStartCommand = cli.Command{ | |
TracingBackend: cfg.TracingBackend, | ||
TracingServiceName: cfg.TracingServiceName, | ||
VerificationFailureBehaviour: cfg.VerificationFailureBehavior, | ||
KubernetesExec: cfg.KuberentesExec, | ||
|
||
SigningJWKSFile: cfg.SigningJWKSFile, | ||
SigningJWKSKeyID: cfg.SigningJWKSKeyID, | ||
|
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.
This seems to be new. Just for my curiosity, what is this impacting?
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.
Previously, if
kubernetes-exec
were enabled (as an experiment), it would be passed down to the subprocess via theBUILDKITE_AGENT_EXPERIMENTS
variable. Now it could be set in the parent process via a flag, we should ensure that if enabled it should be passed to the subprocess.But we'll make the k8s controller set this anyway, so it's probably unnecessary.