falcosecurity-retire / kubernetes-response-engine

37 stars 14 forks source link

No module named 'pendulum' for kubeless function named falco-delete #8

Closed developer-guy closed 4 years ago

developer-guy commented 4 years ago

Describe the bug I tried to deploy pod delete function for terminal_in_shell_container subject on nats, I got following error :

kubectl logs -f falco-delete-f4b7b5956-b5kpz                                    🐳(docker-desktop)  [9884fa7]
Traceback (most recent call last):
  File "/kubeless.py", line 12, in <module>
    '/kubeless/%s.py' % os.getenv('MOD_NAME'))
  File "/opt/bitnami/python/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/kubeless/delete.py", line 5, in <module>
    import playbooks
  File "/kubeless/playbooks/__init__.py", line 3, in <module>
    import pendulum
ModuleNotFoundError: No module named 'pendulum'

How to reproduce it ./deploy_playbook -p delete -s "falco.notice.terminal_shell_in_container"

Expected behaviour Function needs to be created successfully.

Screenshots

Screen Shot 2020-05-03 at 15 28 36

Environment

minikube , k8s 1.17

ghost commented 4 years ago

Looks like you are on right road. I saw the error logs you shared, probably you might have missed one of the step to configure pipenv in order to use kubeless function

You can do that via following commands:

pip3 install --user pipenv
export PATH=$PATH:~/.local/bin
developer-guy commented 4 years ago

Looks like you are on right road. I saw the error logs you shared, probably you might have missed one of the step to configure pipenv in order to use kubeless function

You can do that via following commands:

pip3 install --user pipenv
export PATH=$PATH:~/.local/bin

it worked , thank you 👍