Shell-operator does not create task to exec when received event
Expected behavior: Shell-operator handle new event
Actual behavior: Shell-operator receive event but doesn't handle it, doesn't create task for this.
Steps to reproduce:
- Create hook with config like that:
{
"configVersion":"v1",
"kubernetes": [
{
"name": "GIT-SYNC-PD",
"allowFailure": false,
"apiVersion": "kubeflow.org/v1alpha1",
"kind": "PodDefault",
"executeHookOnEvent": ["Added","Deleted"],
"labelSelector": {
"matchLabels": {
"service/git-sync": "part-of",
}
},
"namespace": {
"labelSelector": {
"matchLabels": {
"app.kubernetes.io/part-of": "kubeflow-profile"
}
}
},
"queue": "git-sync"
}
]
}
- Create namespace with label "app.kubernetes.io/part-of": "kubeflow-profile"
- Create poddefault in created namespace, like that:
apiVersion: kubeflow.org/v1alpha1
kind: PodDefault
metadata:
labels:
service/git-sync: part-of
name: git-repository-access
namespace: user-namespace
spec:
desc: Access to GIT repository
labels:
label/added: "test"
Environment:
- Shell-operator version: v1.0.9
- Kubernetes version: 1.18.10
- Installation type: helm
Logs
{"level":"debug","msg":"kubernetes[1]{GIT-SYNC-PD}: Added user-namespace/PodDefault/git-repository-access: send KubeEvent","time":"2022-04-11T18:33:32+03:00"}
In pod log i see only line about event, nothing else (Usual after such line followed line like "Create tasks for 'kubernetes' event 'Event 'Added' for ...". If i recreate(delete/apply) poddefault in namespace created before started shell-operator - hook executed successful. If i restart shell-operator and recreate(delete/apply) poddefault resource in "user-namespace" namespace - hook executed successful.
Hello! Thank you for report. Seems a bug in "dynamic namespace" support. I'll check it.
any updates?
Should be fixed by https://github.com/flant/shell-operator/pull/411 I'm going to close this. If you still have a problem, feel free to open a new issue.