Skip to content

Commit

Permalink
Add deprecation notice to code (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
thom-at-redhat authored Jul 31, 2024
1 parent 24d8a6c commit 1cffdce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/source/user_guide/configuration_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ Configure workers that process units of work
- Run a worker using Kubernetes
* - ``--work-python``
- Run a worker using a Python plugin
[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release
* - ``--work-signing``
- Private key to sign work submissions
* - ``--work-verification``
Expand Down Expand Up @@ -720,7 +721,7 @@ Work Kubernetes
Work Python
^^^^^^^^^^^

.. list-table:: Work Python
.. list-table:: Work Python [DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release
:header-rows: 1
:widths: auto

Expand Down
8 changes: 6 additions & 2 deletions pkg/workceptor/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package workceptor

import (
"encoding/json"
"errors"
"fmt"
"os/exec"

Expand All @@ -21,6 +22,7 @@ type pythonUnit struct {

// Start launches a job with given parameters.
func (pw *pythonUnit) Start() error {
pw.UpdateBasicStatus(WorkStatePending, "[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release.", 0)
pw.UpdateBasicStatus(WorkStatePending, "Launching Python runner", 0)
config := make(map[string]interface{})
for k, v := range pw.config {
Expand Down Expand Up @@ -72,10 +74,12 @@ func (cfg workPythonCfg) NewWorker(_ BaseWorkUnitForWorkUnit, w *Workceptor, uni
func (cfg workPythonCfg) Run() error {
err := MainInstance.RegisterWorker(cfg.WorkType, cfg.NewWorker, false)

return err
errWithDeprecation := errors.Join(err, errors.New("[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release"))

return errWithDeprecation
}

func init() {
cmdline.RegisterConfigTypeForApp("receptor-workers",
"work-python", "Run a worker using a Python plugin", workPythonCfg{}, cmdline.Section(workersSection))
"work-python", "Run a worker using a Python plugin\n[DEPRECATION WARNING] This option is not currently being used. This feature will be removed from receptor in a future release.", workPythonCfg{}, cmdline.Section(workersSection))
}

0 comments on commit 1cffdce

Please sign in to comment.