Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helmInstall: Cannot set the value of read-only property 'releaseName' #85

Closed
andysworkshop opened this issue Oct 1, 2020 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@andysworkshop
Copy link

andysworkshop commented Oct 1, 2020

My release name has a hyphen in it so I tried to override it in the DSL:

helm {
  releases {
    myRelease {
      from charts.myRelease
      releaseName = "my-release"
    }
  }
}

This results in the above error about the name being read only. Can I set the release name without having to define a whole new task deriving from HelmInstall? I would like to use the tasks that the plugin kindly generates for me.

@tkrullmann
Copy link
Member

Strange, releaseName is a Property<String> so the set accessor for Groovy DSL should be generated by Gradle. I'll investigate!

In the meantime, you could try method syntax:

releaseName "my-release"

or calling .set() on the property explicitly:

releaseName.set "my-release"

It should also be ok to use the hyphenated name for your DSL object (just use quotes), the plugin will automatically convert it to camel case when generating task names.

@andysworkshop
Copy link
Author

I had no idea you could just quote hyphenated values in the DSL, this works:

helm {
  releases {
    "my-release" {
      from charts.myRelease
    }
  }
}

I guess I learned something new today! I'm good now, thanks very much for your help and for providing this plugin - easily the best gradle helm plugin there is.

@tkrullmann
Copy link
Member

Thanks! Glad to hear the workaround works for you.

I'll leave this open as it's indeed a bug. I did some clever stuff with multiple interface inheritance and Kotlin delegates, which ended up hiding the Gradle-generated members on HelmRelease. This shouldn't be necessary when moving to Gradle-managed types, but I have to check Gradle version compatibility (wouldn't want to require a higher Gradle version for a bugfix just yet).

@tkrullmann
Copy link
Member

fixed in 1.2.3 and 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants