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

Setting the Helm client download via the DSL #137

Open
bmuschko opened this issue Oct 12, 2021 · 6 comments
Open

Setting the Helm client download via the DSL #137

bmuschko opened this issue Oct 12, 2021 · 6 comments

Comments

@bmuschko
Copy link
Contributor

At this time, the plugin scans the project property helm.client.download.baseUrl to provide a custom download URL. In my use case, the plugin is bundled with an internal, company-wide plugin which should point your plugin to a custom download URL. AFAIK, a plugin cannot set a project property from code or bundle a gradle.properties. There needs to be another way to set the property via the plugin DSL.

@tkrullmann
Copy link
Member

Hi,

did you try to set the project property via ext / extra?

extra.set("helm.client.download.baseUrl", "https://custom.get.helm.sh")

I think it should be fine to set this the build script, even after applying the plugin, because the plugin uses lazy providers for all the project properties, so it won't be evaluated until the download is actually performed.

As a note, I just had to change how the download works, because the current behavior was conflicting with Gradle's dependencyResolutionManagement feature, instead of adding a custom artifact repository it now installs a task on the root project that does the download using plain-old HttpURLConnection. It's on the root project so all the subprojects can sync on the download and don't do multiple downloads in parallel.

This means that the helm.client.download.baseUrl property must be set on the root project, and different subprojects cannot use a different base URL (but that shouldn't be a problem in your case)

@bmuschko
Copy link
Contributor Author

bmuschko commented Nov 12, 2021

Gradle properties are a different concept than extra properties so I doubt this will work. You can only set Gradle properties by adding it to gradle.properties or by providing them with -P on the command line.

I tried it out with the following build script and it doesn't work.

plugins {
    id 'org.unbroken-dome.helm' version '1.6.1'
}

helm {
    downloadClient {
        enabled = true
        version = '3.4.0'
    }
}

ext.set('helm.client.download.baseUrl', 'https://custom.get.helm.sh')

Why don't we introduce a new property to helm.downloadClient? For example:

helm {
    downloadClient {
        baseUrl = 'https://custom.get.helm.sh'
    }
}

@bmuschko
Copy link
Contributor Author

Could you please comment on this? Happy to provide a pull request if that's the way to go.

@bmuschko
Copy link
Contributor Author

bmuschko commented Dec 2, 2021

Ping!

@vojtechvit
Copy link

Hey folks, can we merge this one please? It's an important one for us

@dswiecki
Copy link

dswiecki commented Nov 9, 2022

It looks as if https://get.helm.sh/ is no longer available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants