influxdata / influxdata/influxdb

Provide a way to remove individual resources from a stack

Open
#20,877 0 comments 3 reactions 0 assignees View on GitHub
area/2.x area/api area/cli
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Proposal:__
Provide a command line option for the `influx stacks update` command that allows you to remove and/or stop tracking an individual task, dashboard, alert, etc.

__Current behavior:__
As it stands, it is possible to add a resource to an influx stack by running `influx stacks update --addResource`, but there is no way to remove a resource without deleting the entire stack, along with all of its resources. If a user deletes a dashboard/task/alert in the UI that was part of a stack, running `influx export` on the stack (or running `stack pull` if using the [`stack` command line utility](https://github.com/influxdata/storage_dashboards_tasks)) will fail with the following error message:

```
Error: Failed to clone resource: resource_id= resource_kind= err="cloning resource: finding resource labels: not found".
See 'influx export -h' for help
```

__Desired behavior:__
Remove an individual dashboard/task/alert/whatever from a stack. Something analogous to the `--addResource` option, but... ya know, in reverse?

Additionally, find a way to gracefully handle the situation that arises when a resource is part of a stack, but is deleted via the UI.

__Alternatives considered:__
~~Eating my computer out of frustration~~

If you have already saved the desired state of a stack (as can be done via `stack pull`), you can use `stack push` to overwrite the stack and get everything back into sync.

__Use case:__

Query team has a lot of old, deprecated dashboards/tasks/alerts that are tracked via stacks. We would like a cleaner way to remove them.

Contributor guide

Open the contributing guide

Research direction

Start at the `influx stacks update` command and its existing `--addResource` option, then trace how stack export and pull handle resources deleted through the UI. Done means an individual dashboard, task, alert, or similar resource can be removed or untracked without deleting the stack, and deleted resources are handled gracefully.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.