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

Missing PkgVersion function #2580

Closed
hagaibarel opened this issue Sep 27, 2023 · 4 comments · Fixed by #2591
Closed

Missing PkgVersion function #2580

hagaibarel opened this issue Sep 27, 2023 · 4 comments · Fixed by #2591
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@hagaibarel
Copy link

What happened?

Since version 4.1.0 the PkgVersion() function is missing from the sdk. It seems that #2519 moved the pulumiUtilites.go file to an internal pkg but that isn't importable.

The problem is the tools such as crd2pulumi relay on that function when generating the code and the code is broken as of 4.1.0.

A possible solution (see pulumi/pulumi#13749) would be to rename the internal pkg to something else (e.g. utilities) so it can be importable

Example

Run [email protected] on any crd yaml file and observe that the generated code is broken

Output of pulumi about

CLI
Version 3.85.0
Go Version go1.21.1
Go Compiler gc

Plugins
NAME VERSION
go unknown
kubernetes 4.0.3

Host
OS ubuntu
Version 23.04
Arch x86_64

This project is written in go: executable='/usr/local/go/bin/go' version='go version go1.21.1 linux/amd64'

backend and resource list redacted for brevity

Dependencies:
NAME VERSION
github.com/bringg/pulib 1.0.5
github.com/creasty/defaults 1.7.0
github.com/onsi/ginkgo/v2 2.12.1
github.com/onsi/gomega 1.27.10
github.com/pulumi/pulumi-kubernetes/sdk/v4 4.0.3
github.com/pulumi/pulumi/sdk/v3 3.85.0
golang.org/x/exp 0.0.0-20230811145659-89c5cff77bcb

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@hagaibarel hagaibarel added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 27, 2023
@mikhailshilkov
Copy link
Member

@guineveresaenger Was this effect intended in pulumi/pulumi#13136? Can we solve this in crd2pulumi or do we need to change codegen again?

@guineveresaenger
Copy link
Contributor

Hi! Apologies @hagaibarel - I'm at Grace Hopper this week so reply may be slower than usual.

We definitely intended to put pulumiUtilities in an internal package, because these are, at the heart of it, internal files.
However, we do have an override for providers that rely on pulumiVersion to be externally available and pulumi/pulumi#13749, as you linked, is the correct path forward here.

@mikhailshilkov -we thankfully do not need to change codegen again.

@hagaibarel
Copy link
Author

Thanks for reply @guineveresaenger, is there anything I can do to help move this forward? It's important for us as we rely on crd2pulumi for generating go typed definitions and are blocked from upgrading the kubernetes provider in our pulumi programs because of this

@mikhailshilkov mikhailshilkov removed the needs-triage Needs attention from the triage team label Oct 2, 2023
@mikhailshilkov mikhailshilkov added this to the 0.95 milestone Oct 2, 2023
guineveresaenger added a commit that referenced this issue Oct 3, 2023
- Set Go's internalModuleName to utilities instead of internal
- Regenerate Go SDK

### Proposed changes

Rename `internal` to `utilities` to make package accessible for
dependent libraries

### Related issues (optional)

Fixes #2580
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Oct 3, 2023
@honne23
Copy link

honne23 commented Dec 7, 2023

Hey I think codegen still needs to be changed as it is still using the depracted kubernetes.PkgVersion() while also relying on the v3 libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants