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 validation: validate IPv6 proxy URL only when IS_IPV6 is set to True #15413

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

ogajduse
Copy link
Member

Problem Statement

Using latest robottelo, including the IPv6-related changes, I am running into

dynaconf.validator.ValidationError: server.http_proxy_ipv6_url must is_type_of <class 'str'> but it is None in env main

This error is caused by a validator that enforces string type, but it is setting the value to None itself. :meow_shrugs:

Validator('server.http_proxy_ipv6_url', is_type_of=str, default=None),

Solution

Utilize conditional validation - validate the IPv6 proxy URL setting only when IS_IPV6 is set to True
https://www.dynaconf.com/validation/#conditional-validation

Related Issues

This should be fixed before #15289 goes in

@ogajduse ogajduse added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Jun 14, 2024
@ogajduse ogajduse self-assigned this Jun 14, 2024
@ogajduse ogajduse requested a review from a team as a code owner June 14, 2024 13:51
Copy link
Contributor

@rmynar rmynar left a comment

Choose a reason for hiding this comment

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

Maybe default='' might be helpful, but not necessary. ACK

@jyejare jyejare removed 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 labels Jun 14, 2024
@jyejare
Copy link
Member

jyejare commented Jun 14, 2024

@ogajduse I just backported Ipv6 to 6.15 and it likely won't go beyond that. If needed we can do cherry-pick later.

@lpramuk lpramuk added 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 and removed 6.12.z Introduced in or relating directly to Satellite 6.12 labels Jun 17, 2024
@lpramuk
Copy link
Contributor

lpramuk commented Jun 17, 2024

Cherrypicking this PR should follow cherrypicking of previous validators fixes - #15277
Setting labels accordingly.

@lpramuk lpramuk merged commit 90ffb9b into SatelliteQE:master Jun 17, 2024
18 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 17, 2024
@ogajduse ogajduse deleted the fix/ipv6-config-validation branch June 17, 2024 09:15
ogajduse added a commit to ogajduse/robottelo that referenced this pull request Jun 17, 2024
ogajduse added a commit to ogajduse/robottelo that referenced this pull request Jun 17, 2024
lpramuk pushed a commit that referenced this pull request Jun 17, 2024
… set to True (#15423)

Fix validation: validate IPv6 proxy URL only when IS_IPV6 is set to True (#15413)

(cherry picked from commit 90ffb9b)

Co-authored-by: Ondřej Gajdušek <[email protected]>
lpramuk pushed a commit that referenced this pull request Jun 17, 2024
… set to True (#15425)

Fix validation: validate IPv6 proxy URL only when IS_IPV6 is set to True (#15413)

(cherry picked from commit 90ffb9b)
lpramuk pushed a commit that referenced this pull request Jun 17, 2024
… set to True (#15424)

Fix validation: validate IPv6 proxy URL only when IS_IPV6 is set to True (#15413)

(cherry picked from commit 90ffb9b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants