Skip to content

Conversation

cybertron
Copy link
Member

No description provided.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 26, 2025
Copy link
Contributor

openshift-ci bot commented Aug 26, 2025

Hello @cybertron! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

Copy link
Contributor

openshift-ci bot commented Aug 26, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 26, 2025
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 26, 2025
Copy link
Contributor

openshift-ci bot commented Aug 26, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cybertron
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

// api, api-int, and ingress.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum=Enabled;Disabled
// +openshift:validation:featureGate=OnPremInternalDNSRecords
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, this isn't a real marker. Let's remove this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, yeah I was throwing stuff at the wall when I had trouble with the feature gate.

@@ -1026,6 +1033,15 @@ type BareMetalPlatformStatus struct {
// +optional
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// internalDNSRecords determines whether we deploy with internal records enabled for
// api, api-int, and ingress.
// +kubebuilder:validation:Optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This is essentially a duplicate of the +optional marker below. We prefer the use of the +optional marker so let's remove this one.

// +openshift:validation:featureGate=OnPremInternalDNSRecords
// +openshift:enable:FeatureGate=OnPremInternalDNSRecords
// +optional
InternalDNSRecords InternalDNSRecordsType `json:"internalDNSRecords"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is an optional field and the zero value is invalid, this should have omitempty.

Comment on lines +186 to +191
type InternalDNSRecordsType string

const (
InternalDNSRecordsDisabled InternalDNSRecordsType = "Disabled"
InternalDNSRecordsEnabled InternalDNSRecordsType = "Enabled"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally we try to avoid the terminology Enabled and Disabled where possible because the terms can often be overloaded and cause confusion.

What if instead of naming the field this applies to internalDNSRecords, what if we named it something like dnsRecordsPolicy (or maybe dnsRecordsType? not sure which one is better) and we had Internal and External as the options?

Comment on lines +1036 to +1037
// internalDNSRecords determines whether we deploy with internal records enabled for
// api, api-int, and ingress.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include validation constraints in the GoDoc here so that this is more end-user friendly. This is the text used in our generated API documentation and what users will see when they use something like oc explain ... so we should make sure it reads appropriately as end-user documentation.

Some good guidelines for things to take into consideration for inclusion in the GoDoc are here: https://github.com/openshift/enhancements/blob/master/dev-guide/api-conventions.md#write-user-readable-documentation-in-godoc

Comment on lines +1036 to +1044
// internalDNSRecords determines whether we deploy with internal records enabled for
// api, api-int, and ingress.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum=Enabled;Disabled
// +openshift:validation:featureGate=OnPremInternalDNSRecords
// +openshift:enable:FeatureGate=OnPremInternalDNSRecords
// +optional
InternalDNSRecords InternalDNSRecordsType `json:"internalDNSRecords"`

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like we have only added this to the BareMetalPlatformStatus type? Is this because the OpenShift installer will end up setting this value at install time?

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand the EP correctly as well, this sounds like this should only be possible to set when loadBalancer is set to UserManaged?

Do we need some additional validation logic (maybe a CEL expression) to enforce that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this will be populated by the installer. I have a validation in the installer to ensure it isn't set when it shouldn't be, but I can move that here if it would be better.

I should also note that this is only a partial version of the change. Because these are per-platform types we'll need to apply the same change to the other on-prem platforms once we know what it should look like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants