Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,7 @@ tests:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: IPv4
region: us-east-1
resourceTags:
- key: key with space
Expand Down Expand Up @@ -1783,6 +1784,7 @@ tests:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: IPv4
region: us-east-1
resourceTags:
- key: key:_./=+-@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- AWSClusterHostedDNSInstall
- -AWSDualStackInstall
tests:
onCreate:
- name: Should be able to create a minimal Infrastructure
Expand Down Expand Up @@ -61,6 +60,7 @@ tests:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: IPv4
type: AWS
- name: should be able to set dnsType to non-default value of `ClusterHosted`
initial: |
Expand Down Expand Up @@ -102,6 +102,7 @@ tests:
aws:
cloudLoadBalancerConfig:
dnsType: ClusterHosted
ipFamily: IPv4
type: AWS
- name: Should not allow changing the immutable dnsType field
initial: |
Expand Down Expand Up @@ -138,6 +139,7 @@ tests:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: IPv4
type: AWS
expectedStatusError: "status.platformStatus.aws.cloudLoadBalancerConfig.dnsType: Invalid value: \"string\": dnsType is immutable"
- name: Should not accept non-IP address values for Load Balancer IPs
Expand Down Expand Up @@ -214,6 +216,7 @@ tests:
clusterHosted:
apiIntLoadBalancerIPs:
- 10.10.10.20
ipFamily: IPv4
type: AWS
expectedStatusError: "status.platformStatus.aws.cloudLoadBalancerConfig: Invalid value: \"object\": clusterHosted is permitted only when dnsType is ClusterHosted"
- name: Should not accept duplicate IP addresses for any of the Load Balancer IPs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ tests:
platformStatus:
aws:
region: us-east-1
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: DualStackIPv6Primary
type: AWS
expected: |
Expand Down Expand Up @@ -130,6 +132,8 @@ tests:
platformStatus:
aws:
region: us-east-1
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: DualStackIPv4Primary
type: AWS
expected: |
Expand Down Expand Up @@ -191,6 +195,8 @@ tests:
platformStatus:
aws:
region: us-east-1
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: IPv4
type: AWS
updated: |
Expand All @@ -207,6 +213,8 @@ tests:
platformStatus:
aws:
region: us-east-1
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: DualStackIPv6Primary
type: AWS
expectedStatusError: "status.platformStatus.aws.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
Expand All @@ -224,6 +232,8 @@ tests:
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
region: us-east-1
ipFamily: DualStackIPv6Primary
Comment on lines +235 to 238

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove duplicated cloudLoadBalancerConfig mapping keys in the same object.

Both initial and updated payloads define cloudLoadBalancerConfig twice under platformStatus.aws. Duplicate YAML keys are parser-dependent and can invalidate or mask this test case.

Suggested fix
         status:
           controlPlaneTopology: HighlyAvailable
           infrastructureTopology: HighlyAvailable
           platform: AWS
           platformStatus:
             aws:
               cloudLoadBalancerConfig:
                 dnsType: PlatformDefault
               region: us-east-1
-              cloudLoadBalancerConfig:
-                dnsType: PlatformDefault
               ipFamily: DualStackIPv6Primary
             type: AWS

Apply the same deletion in both the initial and updated blocks.

Also applies to: 255-260

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/v1/tests/infrastructures.config.openshift.io/AWSDualStackInstall.yaml`
around lines 235 - 240, The AWSDualStackInstall.yaml test case contains
duplicate cloudLoadBalancerConfig mapping keys under platformStatus.aws in both
the initial and updated payload blocks. Remove the second occurrence of the
cloudLoadBalancerConfig key (which has dnsType: PlatformDefault) from each
block, keeping only one instance of this configuration since both duplicates
have identical values.

type: AWS
Expand All @@ -240,6 +250,8 @@ tests:
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
region: us-east-1
ipFamily: DualStackIPv6Primary
type: AWS
Expand Down Expand Up @@ -277,6 +289,8 @@ tests:
platformStatus:
aws:
region: us-east-1
cloudLoadBalancerConfig:
dnsType: PlatformDefault
ipFamily: DualStackIPv4Primary
type: AWS
updated: |
Expand Down
9 changes: 9 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,15 @@ type AWSPlatformStatus struct {
// IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
// protocol family.
//
// Valid values are:
// * "IPv4" (default): Cloud platform resources use IPv4 addressing only.
// * "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
// * "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.
//
// When omitted, this field defaults to "IPv4".
//
// This field is immutable and cannot be changed once set.
//
// +default="IPv4"
// +kubebuilder:default="IPv4"
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="ipFamily is immutable once set"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,30 @@ spec:
ClusterHosted
rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
? !has(self.clusterHosted) : true'
ipFamily:
default: IPv4
description: |-
ipFamily specifies the IP protocol family that should be used for AWS
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
- DualStackIPv4Primary
type: string
x-kubernetes-validations:
- message: ipFamily is immutable once set
rule: oldSelf == '' || self == oldSelf
Comment on lines +1290 to +1313

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. ipfamily docs omit constraints 📘 Rule violation ⚙ Maintainability

The new ipFamily schema includes a default, an enum, and an immutability
x-kubernetes-validations rule, but its description does not document the default/allowed values
or the immutability constraint. This violates the requirement that validation marker semantics be
documented in field comments/user-facing docs.
Agent Prompt
## Issue description
The `ipFamily` field’s schema adds `default`, `enum`, and an immutability `XValidation`, but the user-facing field documentation does not describe:
- what happens when the field is omitted (defaulting)
- the allowed enum values (and what each means)
- that the value is immutable once set

## Issue Context
This is surfaced in generated CRD/OpenAPI documentation, so missing details violate the requirement that validation marker semantics be documented.

## Fix Focus Areas
- config/v1/types_infrastructure.go[567-577]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml[1188-1202]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml[1188-1202]
- machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-Default.crd.yaml[1480-1494]
- machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-OKD.crd.yaml[1480-1494]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This sounds like a legitimate issue to me

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right. I think this is just saying the comment should contain something like:

// Valid values are "IPv4", "DualStackIPv4Primary", and "DualStackIPv6Primary". When omitted, the default value is "IPv4".

It's also outside the scope of this PR, so I would consider it more of a nice to have

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nrb, @patrickdillon I can add a follow-up patch for all 3 platforms. I don't think we had followed that pattern in the past. But a good recommendation to follow for the future.

region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.
Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.
When omitted, this field defaults to "IPv4".
This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.
Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.
When omitted, this field defaults to "IPv4".
This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,30 @@ spec:
ClusterHosted
rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
? !has(self.clusterHosted) : true'
ipFamily:
default: IPv4
description: |-
ipFamily specifies the IP protocol family that should be used for AWS
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
- DualStackIPv4Primary
type: string
x-kubernetes-validations:
- message: ipFamily is immutable once set
rule: oldSelf == '' || self == oldSelf
region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,15 @@ spec:
network resources. This controls whether AWS resources are created with
IPv4-only, or dual-stack networking with IPv4 or IPv6 as the primary
protocol family.

Valid values are:
* "IPv4" (default): Cloud platform resources use IPv4 addressing only.
* "DualStackIPv6Primary": Cloud platform resources use dual-stack networking with IPv6 as the primary protocol family.
* "DualStackIPv4Primary": Cloud platform resources use dual-stack networking with IPv4 as the primary protocol family.

When omitted, this field defaults to "IPv4".

This field is immutable and cannot be changed once set.
enum:
- IPv4
- DualStackIPv6Primary
Expand Down
2 changes: 1 addition & 1 deletion config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading