Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events apis are broken #363

Closed
mmulholla opened this issue Mar 3, 2021 · 0 comments · Fixed by devfile/library#65
Closed

Events apis are broken #363

mmulholla opened this issue Mar 3, 2021 · 0 comments · Fixed by devfile/library#65
Assignees
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working

Comments

@mmulholla
Copy link
Contributor

mmulholla commented Mar 3, 2021

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.

@mmulholla mmulholla changed the title Events apis ar broken Events apis are broken Mar 3, 2021
@elsony elsony added area/library Common devfile library for interacting with devfiles kind/bug Something isn't working labels Mar 3, 2021
@maysunfaisal maysunfaisal self-assigned this Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library Common devfile library for interacting with devfiles kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants