feat(workers): worker operational state (#2427)

* feat(workers): worker operational state
This commit is contained in:
Irena Rindos authored and GitHub committed 2022-09-12 16:10:03 -04:00
1 parent f3f0c55d91
commit fc0ead73e6
17 files changed
+696 -166

No files matched your search

+18 -1
View File
@@ -43,11 +43,14 @@ type options struct {
withStopAfter uint
WithCreateControllerLedActivationToken bool
withReleaseVersion string
withOperationalState string
withExcludeShutdownWorkers bool
}
func getDefaultOptions() options {
return options{
withNewIdFunc: newWorkerId,
withNewIdFunc: newWorkerId,
withOperationalState: ActiveOperationalState.String(),
}
}
@@ -204,3 +207,17 @@ func WithReleaseVersion(version string) Option {
o.withReleaseVersion = version
}
}
// WithOperationalState provides an optional operational state.
func WithOperationalState(state string) Option {
return func(o *options) {
o.withOperationalState = state
}
}
// WithExcludeShutdownWorkers provides an optional to filter out workers in shutdown
func WithExcludeShutdownWorkers(exclude bool) Option {
return func(o *options) {
o.withExcludeShutdownWorkers = exclude
}
}