DEV Community

Discussion on: Helm Release Time-To-Live(TTL)⏳💀 for Temporary Environments

Collapse
 
antweiss profile image
Ant(on) Weiss • Edited

First - let me tell you it's a great little feature! Ephemeral helm releases are a definite need.
If they should be defined on helm plugin level is another consideration.
But right now something is broken.
On my M1 MacBook I'm getting:

helm release ttl my-release --set='2 minutes'
/Users/antweiss/Library/helm/plugins/helm-release-plugin/lib/main.sh: line 13: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
error: [ /Users/antweiss/Library/helm/plugins/helm-release-plugin/lib/main.sh at line 9 ]
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
The CronJob "my-release-ttl" is invalid: spec.schedule: Required value
error: [ /Users/antweiss/Library/helm/plugins/helm-release-plugin/release.sh at line 20 ]
Error: plugin "release" exited with error
Enter fullscreen mode Exit fullscreen mode
Collapse
 
rtpro profile image
Arthur Berezin • Edited

@antweiss Thanks, it's a know issue for MacBooks runnig older Bash 3.x. We are using declare -A which was introduced in bash 4.0. We are working on a fix. In the mean time you can upgrade to a newer 4.x or 5.x version of Bash to make it work.

You can find more details in the open issue github.com/JovianX/helm-release-pl...

Collapse
 
antweiss profile image
Ant(on) Weiss

Makes sense!
Upgraded bash with brew install bash
Now I'm getting:

helm release ttl my-release --set='5 minutes'
bash version is 5.1.16(1)-release
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
The CronJob "my-release-ttl" is invalid: spec.schedule: Required value
error: [ /Users/antweiss/Library/helm/plugins/helm-release-plugin/release.sh at line 20 ]
Error: plugin "release" exited with error
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
antweiss profile image
Ant(on) Weiss

Basically date works differently on MacOS. So this is a new bug. :)