I’m trying to build a resource provider and I’m ge...
# general
r
I’m trying to build a resource provider and I’m getting an
impossible type assertion
. Any ideas?
w
This probably means your Go dependencies are not resolving correctly to a single shared solve across the full set of dependencies. Are you following the steps at e.g. https://github.com/pulumi/pulumi-tf-provider-boilerplate?
r
thanks for the link though
w
Got it - we should see about updating those links to all point at the same documentation on this. /cc @stocky-spoon-28903
👍 1
r
@white-balloon-205 I’m trying to port a 3rd party terraform provider and it seems that the terraform provider it references isnt the same
I’m new to golang so any help would be appreciated 👍
w
@stocky-spoon-28903 will definitely be the expert here - I think he may have looked at the Atlas provider at some point as well...
🙂 1
s
@red-lamp-97876 did you use govendor-override for this?
r
@stocky-spoon-28903 no. Should I be?
s
Likely, yes - it’s important that we pull in the exact dependencies of an upstream terraform provider, which dep won’t do by default
👍 1
r
@stocky-spoon-28903 not sure what’s up but the dependencies aren’t being resolved correctly with the constraints. I’m getting stuff like this:
Copy code
(3)	    try <http://github.com/pulumi/pulumi@swgillespie/read-resources-2|github.com/pulumi/pulumi@swgillespie/read-resources-2>
(4)	✗   <http://github.com/pulumi/pulumi@swgillespie/read-resources-2|github.com/pulumi/pulumi@swgillespie/read-resources-2> not allowed by constraint master:
(4)	    master from (root)
(3)	← backtrack: no more versions of <http://github.com/pulumi/pulumi|github.com/pulumi/pulumi> to try
(2)	← backtrack: no more versions of <http://github.com/pmezard/go-difflib|github.com/pmezard/go-difflib> to try
(1)	← backtrack: no more versions of <http://github.com/stretchr/testify|github.com/stretchr/testify> to try
  ✗ solving failed

Solver wall times by segment:
     b-list-versions: 28.446926272s
         b-list-pkgs:  1.785812062s
              b-gmal:  1.669388972s
    b-rev-present-in:  348.168142ms
     b-source-exists:   228.02313ms
             satisfy:    8.567984ms
         select-atom:    7.906699ms
            unselect:    4.908496ms
            new-atom:    2.121935ms
           backtrack:     709.137µs
  b-deduce-proj-root:     561.987µs
         select-root:     313.354µs
               other:      139.59µs

  TOTAL: 32.50354776s
s
@red-lamp-97876 I’ll take a look
(Sorry for the delay here, I’m in Europe so it was ~3 am 🙂 )
The problem I’m seeing suggests the provider isn’t vendored in the way we expect:
Copy code
Solving failure: No versions of <http://github.com/hashicorp/go-multierror|github.com/hashicorp/go-multierror> met constraints:
	3d3c748ffe409ff548330f7311ced98f9da282d7: unable to update checked out version: fatal: reference is not a tree: 3d3c748ffe409ff548330f7311ced98f9da282d7
: command failed: [git checkout 3d3c748ffe409ff548330f7311ced98f9da282d7]: exit status 128
	v1.0.0: Could not introduce <http://github.com/hashicorp/go-multierror@v1.0.0|github.com/hashicorp/go-multierror@v1.0.0>, as it is not allowed by constraint 3d3c748ffe409ff548330f7311ced98f9da282d7 from project <http://github.com/pulumi/pulumi-terraform|github.com/pulumi/pulumi-terraform>.
	master: Could not introduce <http://github.com/hashicorp/go-multierror@master|github.com/hashicorp/go-multierror@master>, as it is not allowed by constraint 3d3c748ffe409ff548330f7311ced98f9da282d7 from project <http://github.com/pulumi/pulumi-terraform|github.com/pulumi/pulumi-terraform>.
r
@stocky-spoon-28903 so I'm guessing I'll have to fork the provider's repo and change the vendor packages? This is getting way more difficult than I anticipated 🤣
s
I’ll take a better look at it but it sounds to me like upstream is hosed there
👍 1