Fix generic type inference in ServerSideApply example - #4909
sarveshkaushal wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sarveshkaushal The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @yue9944882 |
|
I'm not opposed to this PR, but I believe that we build these examples in our CI/CD and CI/CD is passing. Can you take a look and see if we do in fact build the examples, and then also figure out if there is a difference between your environment and our build environment? |
|
Looks like examples module is not included in the CI/CD build logic. That's why it is not failing in the CI/CD pipeline. See this here. java/.github/workflows/bazel.yml Lines 143 to 151 in f7ac17b When we build locally with maven, it includes all the projects from the root regardless of the Bazel configurations. Another related questions - do we want to include the example module in the CI/CD building process? I can ship a follow-up to allow that. |
Summary
Fix the
ServerSideApplyexample by explicitly specifying the resource and list generic types. This prevents Java from inferring their upper-bound types and resolves compilation errors forV1ConfigMapclass.Testing
Ran
mvn installafter the fix and it worked fine on Java 11 and Java 25.Failure
This was the failure when running
mvn installon the project root: