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

openjdk_pkg_install reset_alternatives all the times #677

Open
andrealai75 opened this issue Aug 3, 2022 · 2 comments
Open

openjdk_pkg_install reset_alternatives all the times #677

andrealai75 opened this issue Aug 3, 2022 · 2 comments
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

Comments

@andrealai75
Copy link

πŸ—£οΈ 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

@damacus
Copy link
Member

damacus commented May 9, 2023

Would you like to add the simple PR to fix this? We'll happily release it

@damacus damacus added 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 labels May 9, 2023
@ramereth
Copy link
Contributor

@andrealai75 it looks this was likely fixed in a recent version. Can you please verify that's the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants