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

Duplicate dashboard files when moved to a new folder #590

Open
beasteers opened this issue Feb 19, 2025 · 0 comments
Open

Duplicate dashboard files when moved to a new folder #590

beasteers opened this issue Feb 19, 2025 · 0 comments

Comments

@beasteers
Copy link

Grizzly Version

0.7.1

Expected Behavior

If you pull dashboards from an instance, move the dashboard to a new folder, then pull the dashboards again, the dashboard should be moved to the new local folder.

$ grr pull "grafana/resources/Main Org"

$ ls grafana/**/dashboard-64nrElFmk.yaml
'grafana/resources/Main Org/dashboards/general/dashboard-64nrElFmk.yaml'

# (Move dashboard in Grafana)

$ grr pull "grafana/resources/Main Org"

$ ls grafana/**/dashboard-64nrElFmk.yaml
'grafana/resources/Main Org/dashboards/cecrsfx5y6q68e/dashboard-64nrElFmk.yaml'

Actual Behavior

Instead, due to the fact that grizzly doesn't delete dashboards, both dashboard files remain.

$ grr pull "grafana/resources/Main Org"

$ ls grafana/**/dashboard-64nrElFmk.yaml
'grafana/resources/Main Org/dashboards/general/dashboard-64nrElFmk.yaml'

# (Move dashboard in Grafana)

$ grr pull "grafana/resources/Main Org"

$ ls grafana/**/dashboard-64nrElFmk.yaml
'grafana/resources/Main Org/dashboards/cecrsfx5y6q68e/dashboard-64nrElFmk.yaml'
'grafana/resources/Main Org/dashboards/general/dashboard-64nrElFmk.yaml'

This may be related to #557, #580

To fix this, when reconciling files, you should load an index like

{
    "dashboard-64nrElFmk": "grafana/resources/Main Org/dashboards/cecrsfx5y6q68e/dashboard-64nrElFmk.yaml"
}

and use that to prevent duplicate files.

Steps to Reproduce

$ grr pull "grafana/resources/Main Org"
$ ls grafana/**/dashboard-64nrElFmk.yaml

# (Move dashboard in Grafana)
$ grr pull "grafana/resources/Main Org"
$ ls grafana/**/dashboard-64nrElFmk.yaml
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

No branches or pull requests

1 participant