Skip to content

MGMT-19732: Add ntp_sources field for exclusive NTP configuration#10408

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
yoavsc0302:MGMT-19732/ntp-sources-replace-option-v3
Jun 2, 2026
Merged

MGMT-19732: Add ntp_sources field for exclusive NTP configuration#10408
openshift-merge-bot[bot] merged 3 commits into
openshift:masterfrom
yoavsc0302:MGMT-19732/ntp-sources-replace-option-v3

Conversation

@yoavsc0302
Copy link
Copy Markdown
Contributor

@yoavsc0302 yoavsc0302 commented May 28, 2026

Add a new ntp_sources field to cluster and infra-env models that allows users to specify the complete NTP configuration. When set, only the user-specified sources are included — the default NTP pool is not added.

This field is mutually exclusive with additional_ntp_source — the API rejects requests that set both, checking the resulting DB state on updates to prevent conflicts.

  • Discovery: when ntp_sources is set, add-ntp-sources.sh overwrites the ISO chrony.conf with only the user's servers instead of appending to the default configuration
  • Installation: the default NTP pool is excluded from the generated chrony MachineConfig, while agent-discovered sources from the user's specified servers are preserved
  • NTP resolution: GetClusterNTPSources() and GetHostNTPSources() return ntp_sources when set, preserving backward compatibility with additional_ntp_source when ntp_sources is not set

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

  • New Features

    • Added ntp_sources parameter for cluster and infra-env create/update to specify exclusive NTP sources for hosts.
  • Improvements

    • Enforced mutual exclusivity between ntp_sources and legacy additional_ntp_source(s); tightened validation and refined defaulting.
    • Ignition/chrony generation and manifests updated to honor ntp_sources and optionally overwrite chrony config.
  • Tests

    • Added tests validating chrony manifest behavior with ntp_sources set.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 28, 2026

@yoavsc0302: This pull request references MGMT-19732 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Add a new ntp_sources field to cluster and infra-env models that allows users to specify the complete NTP configuration. When set, only the user-specified sources are included — the default NTP pool is not added.

This field is mutually exclusive with additional_ntp_source — the API rejects requests that set both, checking the resulting DB state on updates to prevent conflicts.

  • Discovery: when ntp_sources is set, add-ntp-sources.sh overwrites the ISO chrony.conf with only the user's servers instead of appending to the default configuration
  • Installation: the default NTP pool is excluded from the generated chrony MachineConfig, while agent-discovered sources from the user's specified servers are preserved
  • NTP resolution: GetClusterNTPSources() and GetHostNTPSources() return ntp_sources when set, preserving backward compatibility with additional_ntp_source when ntp_sources is not set

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-eng/jira-lifecycle-plugin repository.

@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 May 28, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 28, 2026

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-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a62c2e7e-280a-4b42-9e65-07f396839157

📥 Commits

Reviewing files that changed from the base of the PR and between 17455e5 and f090822.

⛔ Files ignored due to path filters (18)
  • api/vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**
  • vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (16)
  • internal/bminventory/inventory.go
  • internal/common/common.go
  • internal/ignition/disconnected.go
  • internal/ignition/discovery.go
  • internal/ignition/templates/add-ntp-sources.sh
  • internal/ignition/templates/discovery.ign
  • internal/network/manifests_generator.go
  • internal/network/manifests_generator_test.go
  • models/cluster.go
  • models/cluster_create_params.go
  • models/infra_env.go
  • models/infra_env_create_params.go
  • models/infra_env_update_params.go
  • models/v2_cluster_update_params.go
  • restapi/embedded_spec.go
  • swagger.yaml
✅ Files skipped from review due to trivial changes (4)
  • models/cluster_create_params.go
  • models/infra_env.go
  • restapi/embedded_spec.go
  • models/infra_env_update_params.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • internal/ignition/disconnected.go
  • models/infra_env_create_params.go
  • models/v2_cluster_update_params.go
  • internal/ignition/discovery.go
  • models/cluster.go
  • internal/network/manifests_generator.go
  • internal/common/common.go
  • internal/network/manifests_generator_test.go
  • internal/ignition/templates/discovery.ign
  • internal/bminventory/inventory.go

Walkthrough

Adds an exclusive ntp_sources field for clusters and infra-envs, updates validation/persistence and selection helpers, and propagates the field into ignition templates and chrony manifest generation with tests.

Changes

NTP Sources Feature

Layer / File(s) Summary
API schema and data models
swagger.yaml, models/cluster.go, models/cluster_create_params.go, models/v2_cluster_update_params.go, models/infra_env.go, models/infra_env_create_params.go, models/infra_env_update_params.go, restapi/embedded_spec.go
swagger.yaml defines six schema locations receiving the ntp_sources property; generated Go model structs and embedded OpenAPI spec follow the same schema additions with documentation indicating exclusive (not additional) NTP configuration.
NTP source selection logic
internal/common/common.go
Updated GetClusterNTPSources to prioritize cluster.NtpSources over AdditionalNtpSource and DB sources; GetHostNTPSources prioritizes infraEnv.NtpSources over AdditionalNtpSources.
Cluster registration with NTP sources
internal/bminventory/inventory.go
Cluster creation defaults AdditionalNtpSource only when both fields unset, validates mutual exclusivity and format of ntp_sources, and persists NtpSources from the request.
Cluster update NTP handling
internal/bminventory/inventory.go
Cluster update now passes current cluster state to updateNtpSources, which computes both fields from existing and incoming values, enforces mutual exclusivity, validates NtpSources, and writes ntp_sources to DB updates when changed.
InfraEnv registration with NTP sources
internal/bminventory/inventory.go
InfraEnv creation persists NtpSources from the request, validates mutual exclusivity and format between ntp_sources and additional_ntp_sources, and applies defaults only when both are unset.
InfraEnv update NTP handling
internal/bminventory/inventory.go
InfraEnv update enforces mutual exclusivity between ntp_sources and additional_ntp_sources, validates the new field when supplied, and writes ntp_sources to DB updates when it differs from persisted value.
Discovery ignition NTP configuration
internal/ignition/discovery.go, internal/ignition/templates/discovery.ign, internal/ignition/templates/add-ntp-sources.sh
Discovery ignition selects NTP sources from infraEnv.NtpSources when set, computes desired sources list, introduces OverwriteNtpConfig flag for chrony.conf overwrite behavior, and updates template conditionals to gate NTP service/script inclusion on desired sources rather than legacy field.
Disconnected ignition NTP configuration
internal/ignition/disconnected.go
Disconnected ignition selects NTP sources from infraEnv.NtpSources when present, otherwise from infraEnv.AdditionalNtpSources, parses comma-separated list with whitespace trimming, and sets resulting sources in the ignition spec.
Chrony manifest generation with exclusive NTP sources
internal/network/manifests_generator.go, internal/network/manifests_generator_test.go
Added exclusiveChronyConf constant without default pool directive; manifest generation selects this template when cluster.NtpSources is set, otherwise falls back to default config; three new test cases validate single value, multiple values, and empty fallback scenarios.

🎯 3 (Moderate) | ⏱️ ~25 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 3 warnings)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error Logging statements expose NTP source values in error messages via log.WithError(err), potentially leaking internal hostnames when private time servers are used. Remove the actual NTP source values from error messages before logging, or avoid logging WithError(err) when the error contains user-supplied infrastructure details like NTP sources.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning New tests lack assertion failure messages. Assertions use bare Expect() calls without diagnostic strings to aid debugging. Add failure messages to assertions, e.g. Expect(err).ToNot(HaveOccurred(), "failed to create manifest") instead of bare Expect(err).ToNot(HaveOccurred())
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Test uses common.TestNTPSourceUnsynced containing hardcoded IPv4 "2.2.2.2", violating IPv6-only compatibility requirements in disconnected environments. Replace TestNTPSourceUnsynced with dual-stack compatible test source or use IP family detection to conditionally set IPv4/IPv6 sources.
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a new ntp_sources field for exclusive NTP configuration. It is specific, related to the changeset, and includes the Jira ticket reference (MGMT-19732).
Description check ✅ Passed The PR description provides comprehensive context including the feature summary, mutual exclusivity behavior, discovery/installation behavior changes, and NTP resolution updates. Required template sections are completed with meaningful content and appropriate checklist items selected.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All three new Ginkgo test names in manifests_generator_test.go are static, descriptive, and deterministic. No dynamic values (UUIDs, timestamps, generated IDs, variables) appear in test titles.
Microshift Test Compatibility ✅ Passed PR adds only unit tests (3 new It() cases in internal/network/manifests_generator_test.go), not e2e tests. Custom check applies only to e2e tests, so check passes.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Tests added are unit tests (not e2e), located in internal/network/ with mock database. They test chrony manifest generation logic and make no multi-node cluster assumptions or SNO incompatibilities.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds NtpSources field for NTP configuration without introducing deployment manifests, pod affinity/anti-affinity, topology constraints, or assumptions about node topology (HA/SNO/TNF/HyperShift).
Ote Binary Stdout Contract ✅ Passed No stdout writes in process-level code detected. All init() functions are auto-generated validators; no fmt.Print, log.Print, or klog calls write to stdout in non-test code.
No-Weak-Crypto ✅ Passed PR introduces no weak crypto: no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, no custom crypto, no insecure secret comparisons. Only NTP sources string handling.
Container-Privileges ✅ Passed PR does not add container/K8s manifests with privileged settings, hostPID/Network/IPC, SYS_ADMIN caps, or allowPrivilegeEscalation. Changes are NTP configuration only.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 28, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with 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.

Inline comments:
In `@internal/bminventory/inventory.go`:
- Around line 441-443: The current nil-only check for
params.NewClusterParams.AdditionalNtpSource and
params.NewClusterParams.NtpSources can treat an explicit empty string as a
supplied value and skip the default; change the logic so empty-string values are
treated as unset: when deciding to assign b.Config.DefaultNTPSource, treat
AdditionalNtpSource as unset if it is nil or
strings.TrimSpace(*params.NewClusterParams.AdditionalNtpSource) == "" and treat
NtpSources as unset if it is nil or has no non-empty entries (e.g., len==0 or
all entries are empty/whitespace); update both the block around
params.NewClusterParams.AdditionalNtpSource (current check at lines ~441) and
the similar logic around lines ~5318-5331 to use these checks so the default is
only suppressed when the caller truly provides replacement sources.

In `@internal/ignition/discovery.go`:
- Around line 293-300: The split of ntp sources (ntpSourcesRaw →
desiredNtpSources) can include whitespace-only or empty tokens which produce
invalid chrony `server` lines; update the logic around
infraEnv.AdditionalNtpSources / infraEnv.NtpSources and the desiredNtpSources
variable to normalize entries by trimming whitespace (strings.TrimSpace) and
filtering out empty strings after splitting, producing a clean []string for
templating so no blank/whitespace-only servers are emitted.

In `@swagger.yaml`:
- Around line 5239-5242: Update the ntp_sources property description to
explicitly state it is mutually exclusive with the additional_ntp_source and
additional_ntp_sources fields (the server rejects payloads that set both);
similarly update the descriptions for all other ntp_sources occurrences to
include the same mutual-exclusivity note so generated docs don’t present them as
independently valid.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f4725766-e154-432c-aabc-6211b41f0e63

📥 Commits

Reviewing files that changed from the base of the PR and between e2aaa3e and caab8e2.

⛔ Files ignored due to path filters (18)
  • api/vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**
  • vendor/github.com/openshift/assisted-service/models/cluster.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/cluster_create_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env_create_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (16)
  • internal/bminventory/inventory.go
  • internal/common/common.go
  • internal/ignition/disconnected.go
  • internal/ignition/discovery.go
  • internal/ignition/templates/add-ntp-sources.sh
  • internal/ignition/templates/discovery.ign
  • internal/network/manifests_generator.go
  • internal/network/manifests_generator_test.go
  • models/cluster.go
  • models/cluster_create_params.go
  • models/infra_env.go
  • models/infra_env_create_params.go
  • models/infra_env_update_params.go
  • models/v2_cluster_update_params.go
  • restapi/embedded_spec.go
  • swagger.yaml

Comment thread internal/bminventory/inventory.go
Comment on lines +293 to +300
// When ntp_sources is set, use it for discovery so the user's servers are available from the start.
ntpSourcesRaw := infraEnv.AdditionalNtpSources
if infraEnv.NtpSources != "" {
ntpSourcesRaw = infraEnv.NtpSources
}
desiredNtpSources := strings.Split(ntpSourcesRaw, ",")
if len(desiredNtpSources) == 1 && desiredNtpSources[0] == "" {
desiredNtpSources = []string{}
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

Filter and trim NTP entries before templating.

Line 298 currently preserves whitespace/empty CSV tokens, which can render invalid server lines downstream (e.g., server iburst). Normalize entries here to keep generated chrony config valid.

Suggested fix
-	desiredNtpSources := strings.Split(ntpSourcesRaw, ",")
-	if len(desiredNtpSources) == 1 && desiredNtpSources[0] == "" {
-		desiredNtpSources = []string{}
-	}
+	var desiredNtpSources []string
+	for _, source := range strings.Split(ntpSourcesRaw, ",") {
+		source = strings.TrimSpace(source)
+		if source != "" {
+			desiredNtpSources = append(desiredNtpSources, source)
+		}
+	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// When ntp_sources is set, use it for discovery so the user's servers are available from the start.
ntpSourcesRaw := infraEnv.AdditionalNtpSources
if infraEnv.NtpSources != "" {
ntpSourcesRaw = infraEnv.NtpSources
}
desiredNtpSources := strings.Split(ntpSourcesRaw, ",")
if len(desiredNtpSources) == 1 && desiredNtpSources[0] == "" {
desiredNtpSources = []string{}
// When ntp_sources is set, use it for discovery so the user's servers are available from the start.
ntpSourcesRaw := infraEnv.AdditionalNtpSources
if infraEnv.NtpSources != "" {
ntpSourcesRaw = infraEnv.NtpSources
}
var desiredNtpSources []string
for _, source := range strings.Split(ntpSourcesRaw, ",") {
source = strings.TrimSpace(source)
if source != "" {
desiredNtpSources = append(desiredNtpSources, source)
}
}
🤖 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 `@internal/ignition/discovery.go` around lines 293 - 300, The split of ntp
sources (ntpSourcesRaw → desiredNtpSources) can include whitespace-only or empty
tokens which produce invalid chrony `server` lines; update the logic around
infraEnv.AdditionalNtpSources / infraEnv.NtpSources and the desiredNtpSources
variable to normalize entries by trimming whitespace (strings.TrimSpace) and
filtering out empty strings after splitting, producing a clean []string for
templating so no blank/whitespace-only servers are emitted.

Comment thread swagger.yaml
Comment on lines +5239 to +5242
ntp_sources:
type: string
description: A comma-separated list of NTP sources (name or IP) to be used as the only NTP configuration for the cluster hosts.
x-nullable: true
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

Document the mutual-exclusivity contract here.

The server rejects payloads that set ntp_sources together with additional_ntp_source(s), but these descriptions do not say that. Generated API docs will otherwise present both fields as independently valid.

Suggested wording
       ntp_sources:
         type: string
-        description: A comma-separated list of NTP sources (name or IP) to be used as the only NTP configuration for the cluster hosts.
+        description: A comma-separated list of NTP sources (name or IP) to be used as the only NTP configuration for the cluster hosts. Mutually exclusive with `additional_ntp_source`.
         x-nullable: true
       ntp_sources:
         type: string
-        description: A comma-separated list of NTP sources (name or IP) to be used as the only NTP configuration for hosts in this infra-env.
+        description: A comma-separated list of NTP sources (name or IP) to be used as the only NTP configuration for hosts in this infra-env. Mutually exclusive with `additional_ntp_sources`.
         x-nullable: true

Also applies to: 5466-5469, 5840-5842, 7808-7810, 7933-7936, 7996-7999

🤖 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 `@swagger.yaml` around lines 5239 - 5242, Update the ntp_sources property
description to explicitly state it is mutually exclusive with the
additional_ntp_source and additional_ntp_sources fields (the server rejects
payloads that set both); similarly update the descriptions for all other
ntp_sources occurrences to include the same mutual-exclusivity note so generated
docs don’t present them as independently valid.

@yoavsc0302 yoavsc0302 force-pushed the MGMT-19732/ntp-sources-replace-option-v3 branch from caab8e2 to 17455e5 Compare May 28, 2026 09:42
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 28, 2026
@yoavsc0302 yoavsc0302 marked this pull request as ready for review May 28, 2026 12:53
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 28, 2026
@openshift-ci openshift-ci Bot requested review from linoyaslan and rccrdpccl May 28, 2026 12:54
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 24.62687% with 101 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.35%. Comparing base (3b239e5) to head (f090822).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
restapi/embedded_spec.go 0.00% 56 Missing ⚠️
internal/bminventory/inventory.go 29.41% 27 Missing and 9 partials ⚠️
internal/common/common.go 0.00% 5 Missing ⚠️
internal/ignition/disconnected.go 71.42% 1 Missing and 1 partial ⚠️
internal/ignition/discovery.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10408      +/-   ##
==========================================
+ Coverage   44.31%   44.35%   +0.04%     
==========================================
  Files         418      418              
  Lines       72844    73051     +207     
==========================================
+ Hits        32280    32403     +123     
- Misses      37639    37713      +74     
- Partials     2925     2935      +10     
Files with missing lines Coverage Δ
internal/network/manifests_generator.go 77.35% <100.00%> (+0.43%) ⬆️
internal/ignition/disconnected.go 68.12% <71.42%> (-0.47%) ⬇️
internal/ignition/discovery.go 84.12% <80.00%> (+9.12%) ⬆️
internal/common/common.go 37.64% <0.00%> (-0.27%) ⬇️
internal/bminventory/inventory.go 71.55% <29.41%> (-0.50%) ⬇️
restapi/embedded_spec.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 3b239e5 and 2 for PR HEAD 17455e5 in total

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2026
Add ntp_sources string field to cluster, cluster-create-params,
v2-cluster-update-params, infra-env, infra-env-create-params, and
infra-env-update-params models.
Auto-generated by skipper make generate.
Add a new ntp_sources field to cluster and infra-env models that allows
users to specify the complete NTP configuration. When set, only the
user-specified sources are included — the default NTP pool is not added.

This field is mutually exclusive with additional_ntp_source — the API
rejects requests that set both, checking the resulting DB state on
updates to prevent conflicts.

- Discovery: when ntp_sources is set, add-ntp-sources.sh overwrites the
  ISO chrony.conf with only the user's servers instead of appending to
  the default configuration
- Installation: the default NTP pool is excluded from the generated
  chrony MachineConfig, while agent-discovered sources from the user's
  specified servers are preserved
- NTP resolution: GetClusterNTPSources() and GetHostNTPSources() return
  ntp_sources when set, preserving backward compatibility with
  additional_ntp_source when ntp_sources is not set
@yoavsc0302 yoavsc0302 force-pushed the MGMT-19732/ntp-sources-replace-option-v3 branch from 17455e5 to f090822 Compare May 31, 2026 08:30
@openshift-ci openshift-ci Bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 31, 2026
@yoavsc0302
Copy link
Copy Markdown
Contributor Author

/retest

3 similar comments
@yoavsc0302
Copy link
Copy Markdown
Contributor Author

/retest

@yoavsc0302
Copy link
Copy Markdown
Contributor Author

/retest

@yoavsc0302
Copy link
Copy Markdown
Contributor Author

/retest

@yoavsc0302
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand, yoavsc0302

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [jhernand,yoavsc0302]

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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

@yoavsc0302: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 0555e95 into openshift:master Jun 2, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants