https://pulumi.com logo
Title
b

bored-monitor-99026

07/08/2021, 11:44 PM
hi when i run
make prepare
by following pulumi-tf-provider-boilerplate readme i have the following error, anyone has idea what i did wrong here?
mv "provider/cmd/pulumi-tfgen-x""yz" provider/cmd/pulumi-tfgen-foo
mv "provider/cmd/pulumi-resource-x""yz" provider/cmd/pulumi-resource-foo
if [[ "Linux" != "Darwin" ]]; then \
        sed -i 's,<http://github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-foo,g|github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-foo,g>' provider/go.mod; \
        find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/foo/g' {} \; &> /dev/null; \
fi
/bin/sh: 1: [[: not found
# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "Linux" == "Darwin" ]]; then \
        sed -i '' 's,<http://github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-foo,g|github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-foo,g>' provider/go.mod; \
        find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/foo/g' {} \; &> /dev/null; \
fi
/bin/sh: 1: [[: not found
to re-produce, follow the readme:
git clone <https://github.com/pulumi/pulumi-tf-provider-boilerplate> pulumi-xyz
cd pulumi-xyz
make prepare NAME=foo REPOSITORY=<http://github.com/pulumi/pulumi-foo|github.com/pulumi/pulumi-foo>
os:
Ubuntu 20.04.2 LTS
b

billowy-army-68599

07/08/2021, 11:46 PM
Switch your shell to bash
b

bored-monitor-99026

07/09/2021, 12:06 AM
thanks, sorry but i did run this
make prepare
in `bash`:
$ echo $0
/usr/bin/bash

$ make prepare NAME=oneandone REPOSITORY=<http://github.com/pulumi/pulumi-oneandone|github.com/pulumi/pulumi-oneandone>
mv "provider/cmd/pulumi-tfgen-x""yz" provider/cmd/pulumi-tfgen-oneandone
mv "provider/cmd/pulumi-resource-x""yz" provider/cmd/pulumi-resource-oneandone
if [[ "Linux" != "Darwin" ]]; then \
        sed -i 's,<http://github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-oneandone,g|github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-oneandone,g>' provider/go.mod; \
        find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/oneandone/g' {} \; &> /dev/null; \
fi
/bin/sh: 1: [[: not found
# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "Linux" == "Darwin" ]]; then \
        sed -i '' 's,<http://github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-oneandone,g|github.com/pulumi/pulumi-xyz,github.com/pulumi/pulumi-oneandone,g>' provider/go.mod; \
        find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/oneandone/g' {} \; &> /dev/null; \
fi
/bin/sh: 1: [[: not found
i know the error message says it ran in
sh
not
bash
but how... i am using wsl2 (not sure this matters)
can i ask a few more questions regarding creating pulumi provider from tf one here? i was following along the boilerplate readme and an example
pulumi-rke
in this
resource.go
you map each resource, but i wonder how do we find the name mapped to: i.e.
servicesEtcdDeprecated
here
b

billowy-army-68599

07/09/2021, 1:04 PM
honestly it's been a while for me, @broad-dog-22463 do you have any insight into these mappings?
b

bored-monitor-99026

07/09/2021, 10:55 PM
i figured, that name is self-defined type in pulumi