Skip to content

Commit 40ab247

Browse files
authored
Merge pull request #890 from buildkite/clean-up-unused-arg
chore: clean up unusused arg
2 parents b358fb2 + 93a8156 commit 40ab247

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

internal/controller/config/agent_config.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ type AgentConfig struct {
2020
NoHTTP2 *bool `json:"no-http2,omitempty"` // BUILDKITE_NO_HTTP2
2121

2222
// Only applies to agents within the pod
23-
Experiments []string `json:"experiment,omitempty"` // BUILDKITE_AGENT_EXPERIMENT
24-
Shell *string `json:"shell,omitempty"` // BUILDKITE_SHELL
25-
NoColor *bool `json:"no-color,omitempty"` // BUILDKITE_AGENT_NO_COLOR
26-
StrictSingleHooks *bool `json:"strict-single-hooks,omitempty"` // BUILDKITE_STRICT_SINGLE_HOOKS
27-
NoMultipartArtifactUpload *bool `json:"no-multipart-artifact-upload,omitempty"` // BUILDKITE_NO_MULTIPART_ARTIFACT_UPLOAD
28-
TraceContextEncoding *string `json:"trace-context-encoding,omitempty"` // BUILDKITE_TRACE_CONTEXT_ENCODING
29-
DisableWarningsFor []string `json:"disable-warnings-for,omitempty"` // BUILDKITE_AGENT_DISABLE_WARNINGS_FOR
30-
DebugSigning *bool `json:"debug-signing,omitempty"` // BUILDKITE_AGENT_DEBUG_SIGNING
31-
GitSkipFetchExistingCommits *bool `json:"git-skip-fetch-existing-commits,omitempty"` // BUILDKITE_GIT_SKIP_FETCH_EXISTING_COMMITS
32-
ContainerStartTimeout *time.Duration `json:"container-start-timeout,omitempty"` // BUILDKITE_KUBERNETES_CONTAINER_START_TIMEOUT
23+
Experiments []string `json:"experiment,omitempty"` // BUILDKITE_AGENT_EXPERIMENT
24+
Shell *string `json:"shell,omitempty"` // BUILDKITE_SHELL
25+
NoColor *bool `json:"no-color,omitempty"` // BUILDKITE_AGENT_NO_COLOR
26+
StrictSingleHooks *bool `json:"strict-single-hooks,omitempty"` // BUILDKITE_STRICT_SINGLE_HOOKS
27+
NoMultipartArtifactUpload *bool `json:"no-multipart-artifact-upload,omitempty"` // BUILDKITE_NO_MULTIPART_ARTIFACT_UPLOAD
28+
TraceContextEncoding *string `json:"trace-context-encoding,omitempty"` // BUILDKITE_TRACE_CONTEXT_ENCODING
29+
DisableWarningsFor []string `json:"disable-warnings-for,omitempty"` // BUILDKITE_AGENT_DISABLE_WARNINGS_FOR
30+
DebugSigning *bool `json:"debug-signing,omitempty"` // BUILDKITE_AGENT_DEBUG_SIGNING
31+
GitSkipFetchExistingCommits *bool `json:"git-skip-fetch-existing-commits,omitempty"` // BUILDKITE_GIT_SKIP_FETCH_EXISTING_COMMITS
32+
ContainerStartTimeout *time.Duration `json:"container-start-timeout,omitempty"` // BUILDKITE_KUBERNETES_CONTAINER_START_TIMEOUT
3333

3434
// Applies differently depending on the container
3535
// // agent start / bootstrap
@@ -132,7 +132,7 @@ func (a *AgentConfig) ApplyToAgentStart(ctr *corev1.Container) {
132132
// up to the user to set it to the path of a key file supplied in their
133133
// container.
134134
if a.SigningJWKSVolume != nil {
135-
dir := normaliseJWKSFile(a.SigningJWKSVolume, &a.SigningJWKSFile, "/buildkite/signing-jwks", "key")
135+
dir := normaliseJWKSFile(&a.SigningJWKSFile, "/buildkite/signing-jwks", "key")
136136
ctr.VolumeMounts = append(ctr.VolumeMounts, corev1.VolumeMount{
137137
Name: a.SigningJWKSVolume.Name,
138138
MountPath: dir,
@@ -146,7 +146,7 @@ func (a *AgentConfig) ApplyToAgentStart(ctr *corev1.Container) {
146146
// the user set VerificationJWKSFile, it's up to the user to set it to the
147147
// path of a key file supplied in their container.
148148
if a.VerificationJWKSVolume != nil {
149-
dir := normaliseJWKSFile(a.VerificationJWKSVolume, &a.VerificationJWKSFile, "/buildkite/verification-jwks", "key")
149+
dir := normaliseJWKSFile(&a.VerificationJWKSFile, "/buildkite/verification-jwks", "key")
150150
ctr.VolumeMounts = append(ctr.VolumeMounts, corev1.VolumeMount{
151151
Name: a.VerificationJWKSVolume.Name,
152152
MountPath: dir,
@@ -176,7 +176,7 @@ func (a *AgentConfig) ApplyToCommand(ctr *corev1.Container) {
176176
if a.SigningJWKSVolume == nil {
177177
return
178178
}
179-
dir := normaliseJWKSFile(a.SigningJWKSVolume, &a.SigningJWKSFile, "/buildkite/signing-jwks", "key")
179+
dir := normaliseJWKSFile(&a.SigningJWKSFile, "/buildkite/signing-jwks", "key")
180180
ctr.VolumeMounts = append(ctr.VolumeMounts, corev1.VolumeMount{
181181
Name: a.SigningJWKSVolume.Name,
182182
MountPath: dir,
@@ -232,7 +232,7 @@ func (a *AgentConfig) applyPluginsVolumeTo(ctr *corev1.Container) {
232232
// default directory.
233233
// If the field points to a string containing an absolute path, return its
234234
// directory.
235-
func normaliseJWKSFile(volume *corev1.Volume, jwksFileField **string, defaultDir, defaultFile string) string {
235+
func normaliseJWKSFile(jwksFileField **string, defaultDir, defaultFile string) string {
236236
if *jwksFileField == nil {
237237
*jwksFileField = ptr.To(defaultFile)
238238
}

0 commit comments

Comments
 (0)