bored-spoon-83710
08/27/2022, 3:13 PMgorgeous-egg-16927
08/30/2022, 4:07 PMFirst issue, the newly generated sdk/go/kubernetes/helm/v3/pulumiUtilities.go file didn’t contain the right package, helm, but v3. Is there a way to override this?I don’t quite understand your question here. There is a
pulumiUtilities.go
file at sdk/go/kubernetes/pulumiUtilities.go
, but not at the path you indicated, so I want to make sure I understand the problem you’re seeing.
… I’d like to know if this is the right way to proceed (it seems not)?I’ve never tried automatically downloading a plugin from an alternative URL like that since I’m normally developing locally, and already have the plugin binary on my path. That said, I wouldn’t expect you to need a replace directive in your test project. I think you’d want to use your own repo for the SDK, and then it would pull the plugin corresponding to the tag specified in your
go.mod
file.
@ancient-policeman-24615 ^ Does that sound right to you?
But, if I understand correctly, I have to manually modify all the other SDKs, right? What about the Java SDK which doesn’t seem to have templates?If you’re wanting to upstream these changes, then yes, the templates would have to be modified for each SDK. The Helm SDK isn’t currently implemented for Java. This unusual workflow is tech debt, which is tracked in this issue, so sorry for the undocumented differences on the code generation here: https://github.com/pulumi/pulumi-kubernetes/issues/1971
ancient-policeman-24615
08/30/2022, 4:18 PMbored-spoon-83710
08/31/2022, 8:47 AMreplace <http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.21.0 => <http://github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3|github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3> v3.22.0-ys.1
My modified provider wasn’t downloaded, it kept downloading the official v3.21.0 plugin.
Then, I tried to modify the plugin download URL (https://github.com/yann-soubeyrand/pulumi-kubernetes/commit/48e619d65cad33eef255e7cd7319c56c935ca486#diff-4b4c0cf2556342956[…]7b7cd8473ba51435199667) and generate a new SDK. This created a new file (https://github.com/yann-soubeyrand/pulumi-kubernetes/blob/test/sdk/go/kubernetes/helm/v3/pulumiUtilities.go) which had the wrong package name (v3 instead of helm) which I manually fixed. I created a new release: https://github.com/yann-soubeyrand/pulumi-kubernetes/releases/tag/v3.22.0-ys.2 and tried to use it in my test project with
replace <http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.21.0 => <http://github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3|github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3> v3.22.0-ys.2
This still didn’t download my modified provider and kept using the official v3.21.0 provider.
I finally force tagged a v3.21.0 version with the same commits (replacing the official v3.21.0 tag) and built a release from it: https://github.com/yann-soubeyrand/pulumi-kubernetes/releases/tag/v3.21.0. I used it in my test project with
replace <http://github.com/pulumi/pulumi-kubernetes/sdk/v3|github.com/pulumi/pulumi-kubernetes/sdk/v3> v3.21.0 => <http://github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3|github.com/yann-soubeyrand/pulumi-kubernetes/sdk/v3> v3.21.0
and it downloaded my modified provider (I had to remove the official provider in ~/.pulumi/plugins
first).
I’ll try directly pointing to my modified SDK without using a replace. However, will I be able to seemlessly switch back to the official provider (without having to recreate the resources in my stacks) if I succeed to get my PR merged?ancient-policeman-24615
08/31/2022, 8:52 AMbored-spoon-83710
08/31/2022, 8:55 AMgorgeous-egg-16927
08/31/2022, 3:38 PMpulumiUtilities.go
file issue, it looks like the following code is supposed to modify the location for the Helm resources: https://github.com/pulumi/pulumi-kubernetes/blob/v3.21.0/provider/cmd/pulumi-gen-kubernetes/main.go#L343-L363
I’m guessing there might be a bug there, or perhaps you are building the SDKs differently. I normally run the following from the root directory:
make ensure build
bored-spoon-83710
08/31/2022, 4:06 PMdiff --git a/provider/cmd/pulumi-gen-kubernetes/main.go b/provider/cmd/pulumi-gen-kubernetes/main.go
index 3b4d5b10..8e66ab94 100644
--- a/provider/cmd/pulumi-gen-kubernetes/main.go
+++ b/provider/cmd/pulumi-gen-kubernetes/main.go
@@ -358,6 +358,7 @@ func writeGoClient(pkg *schema.Package, outdir string, templateDir string) {
"kubernetes/helm/v3/pulumiTypes.go",
"kubernetes/helm/v3/init.go",
"kubernetes/helm/v3/release.go",
+ "kubernetes/helm/v3/pulumiUtilities.go",
},
"package v3",
"package helm")