Skip to content

Conversation

@Fryguy
Copy link
Member

@Fryguy Fryguy commented Nov 18, 2025

On upgrade, the IPBlock was already set and then after upgrade it enters the conditional where it tries to add the NamespaceSelector. So, in that case both are set. Instead, when we set one, we should unset the other to ensure they aren't both set.

This fixes the error:

NetworkPolicy.networking.k8s.io "miq-application-allow-inbound-httpd" is invalid: spec.ingress[0].from[0]: Forbidden: may not specify both ipBlock and another peer

CP4AIOPS-22012

@kschanrtp Please review.

On upgrade, the IPBlock was already set and then after upgrade it enters
the conditional where it tries to add the NamespaceSelector. So, in that
case both are set. Instead, when we set one, we should unset the other
to ensure they aren't both set.

This fixes the error:

    NetworkPolicy.networking.k8s.io "miq-application-allow-inbound-httpd" is
    invalid: spec.ingress[0].from[0]: Forbidden: may not specify both ipBlock
    and another peer

CP4AIOPS-22012
Copy link
Member

@kschanrtp kschanrtp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM. Ye old "you can't have both" error.

@jrafanie jrafanie merged commit fd3a70a into ManageIQ:master Nov 19, 2025
3 checks passed
@Fryguy
Copy link
Member Author

Fryguy commented Nov 19, 2025

Backported to spassky in commit c9bcb6d.

commit c9bcb6d3b173a19b212280808fa7635b72d34c58
Author: Joe Rafaniello <[email protected]>
Date:   Wed Nov 19 08:56:49 2025 -0500

    Merge pull request #1318 from Fryguy/fix_http_policy
    
    Fix issue where IPBlock and NamespaceSelector are mutually exclusive
    
    (cherry picked from commit fd3a70af61e83efae11fa4133c489c2d7a99d20f)

Fryguy pushed a commit that referenced this pull request Nov 19, 2025
Fix issue where IPBlock and NamespaceSelector are mutually exclusive

(cherry picked from commit fd3a70a)
@Fryguy Fryguy deleted the fix_http_policy branch November 19, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants