Skip to content

Commit

Permalink
fix: remove unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vsukhin committed Mar 20, 2024
1 parent 4f1ac29 commit d5deb9a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
8 changes: 3 additions & 5 deletions config/slave-pod-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
{{- end }}
containers:
{{ if .Features.LogsV2 -}}
- name: "{{ .Name }}-logs"
- name: "main-logs"
{{- if .Registry }}
image: {{ .Registry }}/{{ .LogSidecarImage }}
{{- else }}
Expand All @@ -63,18 +63,16 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DEBUG
value: {{ if .Debug }}"true"{{ else }}"false"{{ end }}
- name: NAMESPACE
value: {{ .Namespace }}
- name: NATS_URI
value: {{ .NatsUri }}
- name: ID
value: {{ .Name }}
value: {{ .JobName }}
- name: GROUP
value: test
- name: SOURCE
value: "test-slave-pod:{{ .Name }}-{{ .SlavePodNumber }}"
value: "test-slave-pod:{{ .Name }}"
{{- end }}
- name: main
{{- if .Registry }}
Expand Down
8 changes: 2 additions & 6 deletions contrib/executor/jmeterd/pkg/slaves/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ type PodOptions struct {
ImagePullSecrets []string
ArtifactRequest *testkube.ArtifactRequest
Features testkube.Features
Debug bool
NatsUri string
LogSidecarImage string
SlavePodNumber int
}

// NewClient is a method to create new slave client
Expand Down Expand Up @@ -179,7 +177,7 @@ func (c *Client) createSlavePodObject(runnerExecutionStr []byte, podName string,
if executorJob == nil {
executorJob = &batchv1.Job{}
}
podOptions := c.newPodOptions(runnerExecutionStr, podName, *executorJob, slavePodNumber)
podOptions := c.newPodOptions(runnerExecutionStr, podName, *executorJob)
var buffer bytes.Buffer
podOptions.Jsn = strings.ReplaceAll(podOptions.Jsn, "'", "''")
if err = tmpl.ExecuteTemplate(&buffer, "pod", podOptions); err != nil {
Expand Down Expand Up @@ -248,7 +246,7 @@ func (c *Client) DeleteSlaves(ctx context.Context, meta SlaveMeta) error {
return nil
}

func (c *Client) newPodOptions(runnerExecutionStr []byte, podName string, executorJob batchv1.Job, slavePodNumber int) *PodOptions {
func (c *Client) newPodOptions(runnerExecutionStr []byte, podName string, executorJob batchv1.Job) *PodOptions {
var resources *testkube.PodResourcesRequest
if c.execution.SlavePodRequest != nil {
resources = c.execution.SlavePodRequest.Resources
Expand Down Expand Up @@ -286,10 +284,8 @@ func (c *Client) newPodOptions(runnerExecutionStr []byte, podName string, execut
ImagePullSecrets: c.slavesConfigs.ImagePullSecrets,
ArtifactRequest: artifactRequest,
Features: c.slavesConfigs.Features,
Debug: c.slavesConfigs.Debug,
NatsUri: c.slavesConfigs.NatsUri,
LogSidecarImage: c.slavesConfigs.LogSidecarImage,
SlavePodNumber: slavePodNumber,
}
}

Expand Down
1 change: 0 additions & 1 deletion pkg/executor/client/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ func NewJobOptions(log *zap.SugaredLogger, templatesClient templatesv1.Interface
jobOptions.EnvSecrets,
int(jobOptions.ActiveDeadlineSeconds),
testkube.Features(options.Features),
debug,
natsURI,
images.LogSidecar,
))
Expand Down
3 changes: 0 additions & 3 deletions pkg/executor/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ type SlavesConfigs struct {
EnvSecrets []testkube.EnvReference `json:"envSecrets"`
ActiveDeadlineSeconds int `json:"activeDeadlineSeconds"`
Features testkube.Features `json:"features"`
Debug bool `json:"debug"`
NatsUri string `json:"natsUri"`
LogSidecarImage string `json:"logSidecarImage"`
}
Expand All @@ -206,7 +205,6 @@ func GetSlavesConfigs(initImage string,
envSecrets []testkube.EnvReference,
activeDeadlineSeconds int,
features testkube.Features,
debug bool,
natsUri string,
logSidecarImage string,
) SlavesConfigs {
Expand All @@ -224,7 +222,6 @@ func GetSlavesConfigs(initImage string,
EnvSecrets: envSecrets,
ActiveDeadlineSeconds: activeDeadlineSeconds,
Features: features,
Debug: debug,
NatsUri: natsUri,
LogSidecarImage: logSidecarImage,
}
Expand Down

0 comments on commit d5deb9a

Please sign in to comment.