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

fix: allow resource settings with empty values. #42

Merged
merged 1 commit into from
Jun 11, 2024
Merged

fix: allow resource settings with empty values. #42

merged 1 commit into from
Jun 11, 2024

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Jun 7, 2024

Description

When the policy is used in the Rancher UI the policy settings are sent with empty values when the user does not want to validate a resource type (memory/cpu). This is causing issues because the policy does not allow empty values in the settings. This commit fix that by allowing only a single resource settings to be empty. Not both. Therefore, we fix the issue in the Rancher UI and does not broken the policy usage.

The Rancher UI cannot be fixed in the questions.yaml file because it does not have a feature that allow us to remove the boolean flag when user does not enabled it. Therefore, the settings always sent empty values.

Fix #33

Test

make test e2e-tests

When the policy is used in the Rancher UI the policy settings are sent
with empty values when the user does not want to validate a resource
type (memory/cpu). This is causing issues because the policy does not
allow empty values in the settings. This commit fix that by allowing
only a single resource settings to be empty. Not both. Therefore, we fix
the issue in the Rancher UI and does not broken the policy usage.

The Rancher UI cannot be fixed in the questions.yaml file because it
does not have a feature that allow us to remove the boolean flag when
user does not enabled it. Therefore, the settings always sent empty
values.

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@jvanz jvanz added the kind/bug Something isn't working label Jun 7, 2024
@jvanz jvanz self-assigned this Jun 7, 2024
@jvanz jvanz requested a review from a team as a code owner June 7, 2024 00:34
Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jvanz jvanz merged commit 5ac86f7 into main Jun 11, 2024
8 checks passed
@jvanz jvanz deleted the issue33 branch June 11, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't create policy by filling only CPU settings
2 participants