JovianX / helm-release-plugin

Helm3 plugin that pulls(re-creates) helm Charts from deployed releases, and updates values of deployed releases without the chart.
Apache License 2.0
97 stars 11 forks source link

Add abiltiy to edit vlaues #21

Open rtpro opened 1 year ago

rtpro commented 1 year ago

Add the ability to edit existing helm release values in a text editor.

Command example

helm release values edit <RELEASE NAME>

The command Opens a text editor with the current release values. The values are applied after the changes are saved.


Design


# Create tmp file 
TMPFILE=$(mktemp)

# get values to 
helm  get values <RELEASE> > $(echo $TMPFILE)

# Remove strings "USER-SUPPLIED VALUES:"
sed -i '/USER-SUPPLIED VALUES:/d' $TMPFILE

# Open default text editor 
"${EDITOR:-vi}" $TMPFILE

# Apply values 
helm release upgrade <RELEASE> --values $TMPFILE

# Delete tmp file 
rm -f $TMPFILE