influxdata / influxdata/influxdb

Template export should allow keeping the existing `metadata.name`

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

Description

__Proposal:__
When creating a template using the `export` command it should optionally be possible to keep the exisiting `metadata.name`

__Current behavior:__
Every time `export` is used, new random names are generated. This causes resources to be destroyed if the template is then re-applied. It also changes the order of the resources in the yaml file, which makes it hard to track the changes in version control.

__Desired behavior:__
The export command has a flag that tells it to use the metadata name from the existing resources.

__Alternatives considered:__
Using a local script to change the names after running the export command.

__Use case:__
This would enable a no-code+infrastucture-as-code setup, where a user can make changes in the front end, and have those changes be automatically applied to a code base, that can then be used to deploy the changes idempotently to the same environment or to a new enviroment.

It would also allow templates to be modified using the UI only and exporting again, as only the changes made by the user would be changed in the export (and not the names).

Contributor guide

Open the contributing guide

Research direction

Start by locating the CLI entry point for the export command and reading how it generates resource names and YAML ordering. The work is done when an option preserves existing metadata.name values and the exported resource order remains stable for reapplication and version control.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.