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

fix: avoid error for missing image if pod is provided #715

Merged
merged 1 commit into from
May 20, 2023

Conversation

kurokobo
Copy link
Contributor

Closes #712

Tested this PR in various patterns:

# Fixed: Case that previously resulted in an error as #712
$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true pod=/tmp/pod.yml
INFO 2022/12/24 09:03:25 Initialization complete
# Invalid configuration; resulted expected error
$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true
Error: must specify a container image to run

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true pod=/tmp/pod.yml image=busybox
Error: can only provide Pod when Image, Command, and Params are empty

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true pod=/tmp/pod.yml command=sleep
Error: can only provide Pod when Image, Command, and Params are empty

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true pod=/tmp/pod.yml params=10
Error: can only provide Pod when Image, Command, and Params are empty
# Valid configuration
$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true allowruntimecommand=true
INFO 2022/12/24 09:04:00 Initialization complete

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true allowruntimepod=true
INFO 2022/12/24 09:04:02 Initialization complete

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true image=busybox
INFO 2022/12/24 09:04:06 Initialization complete

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true image=busybox allowruntimecommand=true
INFO 2022/12/24 09:04:08 Initialization complete

$ ./receptor --local-only --work-kubernetes worktype=demo allowruntimeauth=true image=busybox allowruntimepod=true
INFO 2022/12/24 09:04:10 Initialization complete

@shanemcd shanemcd closed this Feb 2, 2023
@shanemcd shanemcd reopened this Feb 2, 2023
@kurokobo
Copy link
Contributor Author

kurokobo commented Feb 2, 2023

CI / receptor (Go 1.19) (pull_request) failed but seems caused by unrelated to the changes made in this PR.

2023-02-02T15:29:43.2907411Z netceptor_test.go:478: timed out waiting for duplicate node to terminate
2023-02-02T15:29:43.2908761Z --- FAIL: TestDuplicateNodeDetection (121.64s)
...
2023-02-02T15:29:49.2362466Z FAIL
2023-02-02T15:29:49.2363079Z FAIL github.com/ansible/receptor/pkg/netceptor 129.570s

2023-02-02T15:30:00.5404997Z --- FAIL: TestNegativeCost (0.07s)
2023-02-02T15:30:00.5405600Z --- PASS: TestNegativeCost/--tcp-listener (0.13s)
2023-02-02T15:30:00.5406130Z --- PASS: TestNegativeCost/--udp-listener (0.22s)
2023-02-02T15:30:00.5406666Z --- FAIL: TestNegativeCost/--ws-listener (0.24s)
...
2023-02-02T15:30:02.3588954Z FAIL
2023-02-02T15:30:02.3611663Z FAIL github.com/ansible/receptor/tests/functional/cli 2.212s

@AaronH88
Copy link
Contributor

Hey @kurokobo , with all the tests updated im sure this PR will pass our checks now.
Would you like to rebase, or shall I do it?

@kurokobo
Copy link
Contributor Author

@AaronH88
Thanks for updating, I've rebased and force-pushed 😃

Copy link
Contributor

@AaronH88 AaronH88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AaronH88 AaronH88 merged commit e3108db into ansible:devel May 20, 2023
@kurokobo kurokobo deleted the kubernetes branch May 20, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Receptor can't be started with pre-defined pod specification
3 participants