Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receptor can't be started with pre-defined pod specification #712

Closed
kurokobo opened this issue Dec 23, 2022 · 0 comments · Fixed by #715
Closed

Receptor can't be started with pre-defined pod specification #712

kurokobo opened this issue Dec 23, 2022 · 0 comments · Fixed by #715

Comments

@kurokobo
Copy link
Contributor

Description

Defining work-kubernetes with pre-defined pod without allowruntimecommand or allowruntimepod causes following error on startup.

$ ./receptor -c ./receptor.yml 
Error: must specify a container image to run

Version

Using Receptor built by make receptor on upstream devel branch.

$ receptorctl --socket /tmp/receptor.sock version
Warning: receptorctl and receptor are different versions, they may not be compatible
receptorctl  1.3.0
receptor     v1.3.0+g8f8481c

Steps to reproduce

Start Receptor with following configuration file.

---
- local-only:
- node:
    id: demo
- log-level:
    level: debug
- control-service:
    service: control
    filename: /tmp/receptor.sock
- work-kubernetes:
    worktype: demo
    authmethod: kubeconfig
    kubeconfig: /etc/rancher/k3s/k3s.yaml
    pod: /tmp/pod.yml
$ ./receptor -c ./receptor.yml 
Error: must specify a container image to run

Appending allowruntimecommand: true or allowruntimepod: true which do not actually make sense to the configuration file solves the issue.

...
- work-kubernetes:
    worktype: demo
    authmethod: kubeconfig
    kubeconfig: /etc/rancher/k3s/k3s.yaml
    pod: /tmp/pod.yml
    allowruntimecommand: true     👈👈👈
$ ./receptor -c ./receptor.yml 
INFO 2022/12/20 06:50:45 Running control service control
INFO 2022/12/20 06:50:45 Initialization complete
...

Additional information

Following validation for cfg.Image == "" should trigger only when cfg.Pod is empty.

if cfg.Pod != "" && (cfg.Image != "" || cfg.Command != "" || cfg.Params != "") {
return fmt.Errorf("can only provide Pod when Image, Command, and Params are empty")
}
if cfg.Image == "" && !cfg.AllowRuntimeCommand && !cfg.AllowRuntimePod {
return fmt.Errorf("must specify a container image to run")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant