terratest icon indicating copy to clipboard operation
terratest copied to clipboard

add --install option to helm upgrade

Open msvechla opened this issue 4 years ago • 2 comments

Hi all,

In our usual CI/CD scripts, we often use helm upgrade --install to avoid special conditions for the initial installation. It would be great if we can have the same option for terratest.

I would be happy to create a PR for this, I am just wondering what would be the best approach to add this. Currently, I would have the following ideas:

  • Option 1: add another parameter like shouldInstall to the Upgrade method: https://github.com/gruntwork-io/terratest/blob/master/modules/helm/upgrade.go#L14
  • Option 2: simply always add the install flag, as the usage of upgrade suggests that something is already installed anyway

What are your thoughts here? Let me know if I should open a PR.

FYI: I am aware that I could do this today via RunHelmCommandAndGetOutputE, however it would be nice to have it available in the mentioned wrapper functions.

Thanks a lot!

msvechla avatar Jun 09 '20 16:06 msvechla

This makes sense to me. Always adding in the --install flag seems reasonable, since for most test use cases that want to test upgrade paths, you would call Upgrade twice anyway

yorinasub17 avatar Jun 09 '20 16:06 yorinasub17

Thanks a lot for the quick feedback, PR is here: #550

msvechla avatar Jun 09 '20 17:06 msvechla