Skip to content

Commit

Permalink
fix: use correct folder uid to update permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
timp87 authored and theSuess committed Jul 4, 2024
1 parent 58f6a0c commit 9855012
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/grafanafolder_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,12 @@ func (r *GrafanaFolderReconciler) onFolderCreated(ctx context.Context, grafana *
return fmt.Errorf("failed to unmarshal spec.permissions: %w", err)
}

_, err = grafanaClient.FolderPermissions.UpdateFolderPermissions(uid, &permissions) //nolint
targetUID := uid
if exists {
targetUID = remoteUID
}

_, err = grafanaClient.FolderPermissions.UpdateFolderPermissions(targetUID, &permissions) //nolint
if err != nil {
return fmt.Errorf("failed to update folder permissions: %w", err)
}
Expand Down

0 comments on commit 9855012

Please sign in to comment.