Skip to content

Commit 4e01160

Browse files
authored
allow overriding the runner's containing executable name (#1813)
* allow overriding the runner's containing executable name Signed-off-by: Etai Lev Ran <elevran@gmail.com> * make use as Name explicit Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
1 parent dd3230c commit 4e01160

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmd/epp/runner/runner.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,26 @@ var (
135135
// NewRunner initializes a new EPP Runner and returns its pointer.
136136
func NewRunner() *Runner {
137137
return &Runner{
138+
eppExecutableName: "GIE",
138139
requestControlConfig: requestcontrol.NewConfig(), // default requestcontrol config has empty plugin list
139140
}
140141
}
141142

142143
// Runner is used to run epp with its plugins
143144
type Runner struct {
145+
eppExecutableName string // the EPP executable name
144146
requestControlConfig *requestcontrol.Config
145147
schedulerConfig *scheduling.SchedulerConfig
146148
customCollectors []prometheus.Collector
147149
}
148150

151+
// WithExecutableName sets the name of the executable containing the runner.
152+
// The name is used in the version log upon startup and is otherwise opaque.
153+
func (r *Runner) WithExecutableName(exeName string) *Runner {
154+
r.eppExecutableName = exeName
155+
return r
156+
}
157+
149158
func (r *Runner) WithRequestControlConfig(requestControlConfig *requestcontrol.Config) *Runner {
150159
r.requestControlConfig = requestControlConfig
151160
return r
@@ -176,7 +185,7 @@ func (r *Runner) Run(ctx context.Context) error {
176185
}
177186
}
178187

179-
setupLog.Info("GIE build", "commit-sha", version.CommitSHA, "build-ref", version.BuildRef)
188+
setupLog.Info(r.eppExecutableName+" build", "commit-sha", version.CommitSHA, "build-ref", version.BuildRef)
180189

181190
// Validate flags
182191
if err := validateFlags(); err != nil {

0 commit comments

Comments
 (0)