<#5977 [BUG] Partially configured task resource co...
# flyte-github
c
#5977 [BUG] Partially configured task resource configuration can cause nil pointers and crash Flyte Admin Issue created by Sovietaced ### Describe the bug A task resource configuration that is not completely filled out will cause nil pointers in Flyte Admin because the code assumes every fields is present and complete.
Copy code
runtime/debug.Stack()
	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
github.com/flyteorg/flyte/flyteadmin/pkg/rpc/adminservice.(*AdminService).interceptPanic(0xc00215e000, {0x330c7a8, 0xc004784e70}, {0x33004b0?, 0xc00453cc40})
	/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/base.go:55 +0x7a
panic({0x27d3a40?, 0x4b0b9c0?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/flyteorg/flyte/flyteadmin/pkg/manager/impl/util.fromAdminProtoTaskResourceSpec({0x330c7a8, 0xc004784e70}, _)
	/go/src/github.com/flyteorg/flyteadmin/pkg/manager/impl/util/resources.go:61 +0x73
github.com/flyteorg/flyte/flyteadmin/pkg/manager/impl/util.GetTaskResources({_, _}, _, {_, _}, {_, _})
	/go/src/github.com/flyteorg/flyteadmin/pkg/manager/impl/util/resources.go:108 +0x3c5
github.com/flyteorg/flyte/flyteadmin/pkg/manager/impl.(*TaskManager).CreateTask(0xc000b727e0, {0x330c7a8, 0xc004784e70}, {{{}, {}, {}, 0xc000273000}, 0x0, {0x0, 0x0, ...}, ...})
	/go/src/github.com/flyteorg/flyteadmin/pkg/manager/impl/task_manager.go:64 +0x7f
github.com/flyteorg/flyte/flyteadmin/pkg/rpc/adminservice.(*AdminService).CreateTask.func1()
	/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/task.go:25 +0x9b
github.com/flyteorg/flyte/flytestdlib/promutils.StopWatch.Time({{0x7fd8f7388b40?, 0xc001c91e00?}, 0x280d800?}, 0xc001b28170)
	/go/src/github.com/flyteorg/flytestdlib/promutils/scope.go:58 +0xb6
github.com/flyteorg/flyte/flyteadmin/pkg/rpc/adminservice/util.(*RequestMetrics).Time(...)
	/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/util/metrics.go:33
github.com/flyteorg/flyte/flyteadmin/pkg/rpc/adminservice.(*AdminService).CreateTask(0xc00215e000, {0x330c7a8?, 0xc004784e70?}, 0x2c1bea0?)
	/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/task.go:24 +0x158
### Expected behavior The expected behavior is that Flyte Admin does not throw a nil pointer if only defaults or limits are specified in a task resource configuration. One of the questions that needs to be answered is what is a valid task resource configuration? Once that is understood we can add some validation to the API which accepts this configuration. ### Additional context to reproduce
Copy code
project: flyteexamples
domain: development
limits:
    cpu: "2"
    memory: 450Mi
### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte