Skip to content

Events apis are broken #363

@mmulholla

Description

@mmulholla

using func (d *DevfileV2) AddEvents(events v1.Events) error - result in an error:
--- FAIL: Test_Events (0.00s)

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x1818785]

goroutine 21 [running]:
testing.tRunner.func1.1(0x1a910a0, 0x22b9300)
/usr/local/go/src/testing/testing.go:1072 +0x30d
testing.tRunner.func1(0xc000103380)
/usr/local/go/src/testing/testing.go:1075 +0x41a
panic(0x1a910a0, 0x22b9300)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
github.com/devfile/library/pkg/devfile/parser/data/v2.(*DevfileV2).AddEvents(0xc00030cc80, 0xc000170900, 0x5, 0x8, 0xc000170a80, 0x5, 0x8, 0xc00033cc60, 0x2, 0x2, ...)
/Users/martinmulholland/devfile/library/pkg/devfile/parser/data/v2/events.go:20 +0x45
github.com/devfile/library/tests/v2/utils/library.DevfileFollower.AddEvent(...)

The problem is that the code does not create an Events structure.

Also with UpdateEvents if you pass in an empty array for one of the events it is ignored so you cannot remove an event.

Metadata

Metadata

Assignees

Labels

area/libraryCommon devfile library for interacting with devfileskind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions