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

grr apply crashing when not specifying folder #201

Closed
MrFreezeex opened this issue Jan 26, 2022 · 2 comments · Fixed by #326
Closed

grr apply crashing when not specifying folder #201

MrFreezeex opened this issue Jan 26, 2022 · 2 comments · Fixed by #326
Assignees

Comments

@MrFreezeex
Copy link
Contributor

$ cat dashboard-simple2.yaml
apiVersion: grizzly.grafana.com/v1alpha1
kind: Dashboard
metadata:
    name: prod-overview
spec:
    schemaVersion: 17
    tags:
        - templated
    timezone: browser
    title: Production Overview
    uid: prod-overview
$ ./grr apply dashboard-simple2.yaml
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/grafana/grizzly/pkg/grizzly.(*Resource).GetMetadata(...)
	/drone/src/pkg/grizzly/providers.go:72
github.com/grafana/grizzly/pkg/grafana.postDashboard(0xc000589ec0, 0x18e1200, 0xc00010dad0)
	/drone/src/pkg/grafana/dashboards.go:99 +0xc99
github.com/grafana/grizzly/pkg/grafana.(*DashboardHandler).Add(0x2c02968, 0xc000589ec0, 0x0, 0x0)
	/drone/src/pkg/grafana/dashboard-handler.go:117 +0x2b
github.com/grafana/grizzly/pkg/grizzly.Apply(0xc000132958, 0x1, 0x1, 0xc000589440, 0x3)
	/drone/src/pkg/grizzly/workflow.go:240 +0x49e
main.applyCmd.func1(0xc0004955e0, 0xc0003b3760, 0x1, 0x1, 0x0, 0x0)
	/drone/src/cmd/grr/workflow.go:122 +0x111
github.com/go-clix/cli.(*Command).execute(0xc0004955e0, 0xc0003b3740, 0x1, 0x1, 0xc0004955e0, 0xc0003b3740)
	/go/pkg/mod/github.com/go-clix/cli@v0.2.0/command.go:118 +0x34e
github.com/go-clix/cli.(*Command).Execute(0xc0004943c0, 0xc00073ff28, 0xa)
	/go/pkg/mod/github.com/go-clix/cli@v0.2.0/command.go:76 +0x105
main.main()
	/drone/src/cmd/grr/main.go:44 +0x26b
@malcolmholmes
Copy link
Collaborator

Generally, I would suggest that this should error out, saying "no folder specified". But, in Grafana land, perhaps it is okay to just select the General folder in this case.

WDYT? Could you make a PR?

@MrFreezeex
Copy link
Contributor Author

Well it should already do it actually https://github.com/grafana/grizzly/blob/v0.2.0-beta3/pkg/grafana/dashboard-handler.go#L75.... Not sure why it doesn't, I will try to debug it this week,

@julienduchesne julienduchesne self-assigned this Feb 2, 2024
julienduchesne added a commit that referenced this issue Feb 2, 2024
Closes #201
A bug that is already fixed but untested
@julienduchesne julienduchesne linked a pull request Feb 2, 2024 that will close this issue
julienduchesne added a commit that referenced this issue Feb 2, 2024
Closes #201
A bug that is already fixed but untested
julienduchesne added a commit that referenced this issue Feb 2, 2024
Closes #201
A bug that is already fixed but untested
julienduchesne added a commit that referenced this issue Feb 2, 2024
* Test the case where a dashboard has no specified folder
Closes #201
A bug that is already fixed but untested

* Fix tests
Bringing in features from #325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants