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

Changes in packages for Java SDK #774

Closed
Tracked by #598
salaboy opened this issue Aug 4, 2022 · 15 comments
Closed
Tracked by #598

Changes in packages for Java SDK #774

salaboy opened this issue Aug 4, 2022 · 15 comments
Assignees
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec language/java p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@salaboy
Copy link

salaboy commented Aug 4, 2022

What happened?

I've created a new pulumi kubernetes-java project and the packages used for the Kubernetes objects had been moved to a different package.

Package change from: import com.pulumi.kubernetes.apps_v1 to import com.pulumi.kubernetes.apps.v1

Steps to reproduce

Create new kubernetes-java pulumi app

Expected Behavior

Use the correct packages for the kube APIs

Actual Behavior

wrong package is used

Versions used

CLI
Version 3.37.2
Go Version go1.17.12
Go Compiler gc

Plugins
NAME VERSION
java unknown

Host
OS darwin
Version 12.4
Arch x86_64

This project is written in java: java='openjdk 17.0.2 2022-01-18' javac='17.0.2' maven='Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)'

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).

@salaboy salaboy added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 4, 2022
@salaboy
Copy link
Author

salaboy commented Aug 4, 2022

Fixing the package import doesn't solve the problem as it seems to be a dependency chain issue. When manually updating to the new packages I am getting this issue:


java.lang.UnsupportedOperationException: Convert [com.pulumi.kubernetes.apps.v1.Deployment.spec]: Error converting 'com.google.common.collect.RegularImmutableMap' to 'TypeShape{type=class com.pulumi.kubernetes.apps.v1.outputs.DeploymentSpec, parameters=[]}'. argument type mismatch

So I thought about sharing which maven dependencies are being used:

Screenshot 2022-08-04 at 10 34 43

I wonder if there is a way just to get a stable com.pulumi:kubernetes package.

@stack72
Copy link
Contributor

stack72 commented Aug 4, 2022

Hi @salaboy

Thanks for opening this :) Would you try this package? https://mvnrepository.com/artifact/com.pulumi/kubernetes/3.20.2 I believe that this is ok?

Paul

@salaboy
Copy link
Author

salaboy commented Aug 4, 2022

Yeah.. let me give that a try

@salaboy
Copy link
Author

salaboy commented Aug 4, 2022

@stack72 do you know which version of com.pulumi:pulumi version goes with 3.20.2 ?

@salaboy
Copy link
Author

salaboy commented Aug 5, 2022

@stack72 pulumi up with version 3.20.2 gives the following error:

error: no resource plugin 'pulumi-resource-kubernetes' found in the workspace at version v3.20.2 or on your $PATH, install the plugin using `pulumi plugin install resource kubernetes v3.20.2`

I was expecting that to be done automatically

@salaboy
Copy link
Author

salaboy commented Aug 5, 2022

and after installing the plugin.. I am still getting:

Diagnostics:
  pulumi:pulumi:Stack (platform-api-java-platform-java):
    error: Running program [PID: 23258](/Users/msalatino/.sdkman/candidates/java/current/bin/java -classpath /usr/local/Cellar/maven/3.8.5/libexec/boot/plexus-classworlds-2.6.0.jar -Dclassworlds.conf=/usr/local/Cellar/maven/3.8.5/libexec/bin/m2.conf -Dmaven.home=/usr/local/Cellar/maven/3.8.5/libexec -Dlibrary.jansi.path=/usr/local/Cellar/maven/3.8.5/libexec/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/Users/msalatino/code/fmtok8s/from-monolith-to-k8s/platform/pulumi/java/platform-api-java org.codehaus.plexus.classworlds.launcher.Launcher --no-transfer-progress compile exec:java) failed with an unhandled exception:
    java.lang.UnsupportedOperationException: Convert [com.pulumi.kubernetes.apps.v1.Deployment.spec]: Error converting 'com.google.common.collect.RegularImmutableMap' to 'TypeShape{type=class com.pulumi.kubernetes.apps.v1.outputs.DeploymentSpec, parameters=[]}'. argument type mismatch

@salaboy
Copy link
Author

salaboy commented Aug 5, 2022

I am sure that it is my fault, hence I am sharing my project here: https://github.com/salaboy/from-monolith-to-k8s/tree/main/platform/pulumi/java/platform-api-java

@stack72
Copy link
Contributor

stack72 commented Aug 5, 2022

ok, this REALLY helps :) Thank you for such a detailed report! I will get someone to have a look :)

Paul

@stack72 stack72 removed the needs-triage Needs attention from the triage team label Aug 5, 2022
@stack72
Copy link
Contributor

stack72 commented Aug 5, 2022

@pawelprazak any chance you can have a look here?

@pawelprazak
Copy link
Contributor

I'm sorry, we might have a regression (and a gap in tests).

Reverting kubernetes provider to 3.19.1 and using old imports works around the issue.

I'm working on a real fix.

@pawelprazak pawelprazak self-assigned this Aug 8, 2022
@pawelprazak pawelprazak added language/java impact/regression Something that used to work, but is now broken p1 A bug severe enough to be the next item assigned to an engineer labels Aug 8, 2022
pawelprazak added a commit that referenced this issue Aug 8, 2022
@t0yv0
Copy link
Member

t0yv0 commented Aug 8, 2022

Bumping into this also. Incidentally, pulumi new java-kubernetes is currently broken. Downgrading to 3.19.1 works. Thanks Pawel for picking this up. This seems to work for me:

   export PULUMI_JAVA_SDK_VERSION=0.5.2
   export PULUMI_KUBERNETES_PROVIDER_SDK_VERSION=3.19.1
   make test_template.kubernetes-java

@pawelprazak
Copy link
Contributor

pawelprazak commented Aug 11, 2022

the bot autoclosed, but the change needs to be released for proper fix, not sure if we should reopen

@t0yv0
Copy link
Member

t0yv0 commented Aug 11, 2022

We shouldn't reopen. We close issues and they get released with a bit of delay shortly after.

@salaboy
Copy link
Author

salaboy commented Aug 12, 2022

@pawelprazak @t0yv0 @stack72 thanks for checking this out.. I wanted to make sure that it wasn't a problem on my end. @pawelprazak any idea when this is going to be released?

@t0yv0
Copy link
Member

t0yv0 commented Aug 12, 2022

I think the fix is part of https://github.com/pulumi/pulumi-java/releases/tag/v0.5.3 release yesterday.

@t0yv0 t0yv0 mentioned this issue Aug 16, 2022
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec language/java p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants