https://pulumi.com logo
#general
Title
# general
f

famous-train-16653

02/08/2022, 4:31 PM
Hello everyone, I’m currently converting some pulumi code as pulumi packages since I need to jump between go and TypeScript often and making my code re-usable is a nice bonus. I ‘successfully’ generated a sdk from TypeScript code (i.e. it prompted no errors). Now when importing the go sdk as a module in my go project and launching the main.go entrypoint I get the following error:
Copy code
error: program failed: missing project name
exit status 1
Any idea in which file I omitted the project name to be specified?
The code in question where I import my local ipfs module which is a pulumi package
Copy code
package main

import (
	"fmt"
	"ipfs"

	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {

		uniqueName := pulumi.Sprintf("ipfs-kind")

		labels := make(map[string]interface{})
		labels["cluster_service_id"]  = "test"
		labels["cluster_service_type"] = "ipfs"
		labels[`<http://app.kubernetes.io/instance`|app.kubernetes.io/instance`>] = "test"
		labels[`<http://app.kubernetes.io/name`|app.kubernetes.io/name`>] = fmt.Sprintf("%s", "ipfs-kind")

		selectorLabels := make(map[string]interface{})
		selectorLabels[`<http://app.kubernetes.io/instance`|app.kubernetes.io/instance`>] = "test"
		selectorLabels[`<http://app.kubernetes.io/name`|app.kubernetes.io/name`>] = fmt.Sprintf("%s", "ipfs-kind")

		limits := make(map[string]string)
		limits["cpu"] = "500m"
		limits["mem"] = "1G"
		limits["rps"] = "10"
		limits["storage"] = "10G"

		requests := make(map[string]string)
		requests["cpu"] = "250m"
		requests["mem"] = "512M"

		resources := ipfs.IClusterServiceResourceDefinitionArgs{
			Limits:  pulumi.ToStringMap(limits),
			Requests: pulumi.ToStringMap(requests),
		}

		ipfsArgs := ipfs.IpfsArgs{
			UniqueName: uniqueName,
			Labels: pulumi.ToMap(labels),
			SelectorLabels: pulumi.ToMap(selectorLabels),
			Resources: resources,
		}

		_, err := ipfs.NewIpfs(ctx, "ipfs-kind", &ipfsArgs, nil)

		if err != nil {
			return err
		}

		return nil
	})
}
Stupid mistake, you need to create a project with the pulumi CLI and insert the code in there
3 Views