shell-operator icon indicating copy to clipboard operation
shell-operator copied to clipboard

Shell-operator does not create task to exec when received event

Open and-1 opened this issue 3 years ago • 2 comments

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:

  1. 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"
      }
   ]
}
  1. Create namespace with label "app.kubernetes.io/part-of": "kubeflow-profile"
  2. 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.

and-1 avatar Apr 11 '22 16:04 and-1

Hello! Thank you for report. Seems a bug in "dynamic namespace" support. I'll check it.

diafour avatar Apr 11 '22 17:04 diafour

any updates?

and-1 avatar Apr 15 '22 17:04 and-1

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.

nabokihms avatar May 23 '23 20:05 nabokihms