openjdk_pkg_install reset_alternatives all the times #677
Labels
Bug
Something isn't working
Priority: Medium
Will bring visible benefit to the project
Waiting on Contributor
Awaiting on the person who raised this to update
π£οΈ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
π» Brief Description
The openjdk_pkg_install is resetting the alternatives all the times so a new install wipes out any previous installed Java alternatives.
The issue is that the custom resource openjdk_pkg_install is calling java_alternatives setting the reset_alternatives property from new_resource.reset_alternatives but this is not defined in the resource itself so always default to true.
The fix is very simple add the following to openjdk_pkg_install:
property :reset_alternatives,
[true, false],
default: true,
description: 'Whether to reset alternatives before setting them'
I checked openjdk_source_install and we have similar problem there
π₯ Cookbook version
11.1.0
π©βπ³ Chef-Infra Version
Any.
π© Platform details
Any
Steps To Reproduce
Create a recipe with two openjdk_pkg_install and only the last alternative is created.
π Expected behavior
We should have one alternative for each Java installed
β Additional context
None
The text was updated successfully, but these errors were encountered: