shell-operator
shell-operator copied to clipboard
Panic for bindings without configVersion
While using binding contexts without specifying v1 version (configVersion: v1).
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12f8668]
goroutine 42 [running]:
k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.(*Unstructured).GetNamespace(...)
/go/pkg/mod/k8s.io/[email protected]/pkg/apis/meta/v1/unstructured/unstructured.go:234
github.com/flant/shell-operator/pkg/hook/binding_context.BindingContext.MapV0(0x173e3d8, 0x2, 0x174700f, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/src/shell-operator/pkg/hook/binding_context/binding_context.go:131 +0x208
github.com/flant/shell-operator/pkg/hook/binding_context.BindingContext.Map(0x173e3d8, 0x2, 0x174700f, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/src/shell-operator/pkg/hook/binding_context/binding_context.go:39 +0x11b
github.com/flant/shell-operator/pkg/hook/binding_context.ConvertBindingContextList(0x173e3d8, 0x2, 0xc000aacfd0, 0x1, 0x1, 0x1, 0x1, 0x7e5130)
/src/shell-operator/pkg/hook/binding_context/binding_context.go:145 +0x139
github.com/flant/shell-operator/pkg/hook.(*Hook).Run(0xc00009f220, 0x174700f, 0xa, 0xc00081c160, 0x1, 0x1, 0xc00084d678, 0x0, 0x0, 0x0, ...)
/src/shell-operator/pkg/hook/hook.go:74 +0xf1
github.com/flant/shell-operator/pkg/shell-operator.(*ShellOperator).TaskHandleHookRun(0xc00016efa0, 0x19400a0, 0xc00081e480, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/src/shell-operator/pkg/shell-operator/operator.go:431 +0x7a6
github.com/flant/shell-operator/pkg/shell-operator.(*ShellOperator).TaskHandler(0xc00016efa0, 0x19400a0, 0xc00081e480, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/src/shell-operator/pkg/shell-operator/operator.go:305 +0x1f0
github.com/flant/shell-operator/pkg/task/queue.(*TaskQueue).Start.func1(0xc0003f2000)
/src/shell-operator/pkg/task/queue/task_queue.go:341 +0x3e7
created by github.com/flant/shell-operator/pkg/task/queue.(*TaskQueue).Start
/src/shell-operator/pkg/task/queue/task_queue.go:319 +0x4f
+1
@DTvGe45vc why do you use "v0" (binding without configVersion)?