Skip to content

Add interval and Infoblox maxResults to ExternalDNS CR - #483

Open
sanjaytripathi97 wants to merge 1 commit into
openshift:mainfrom
sanjaytripathi97:add-infoblox-max-results-and-interval
Open

Add interval and Infoblox maxResults to ExternalDNS CR#483
sanjaytripathi97 wants to merge 1 commit into
openshift:mainfrom
sanjaytripathi97:add-infoblox-max-results-and-interval

Conversation

@sanjaytripathi97

@sanjaytripathi97 sanjaytripathi97 commented Jun 1, 2026

Copy link
Copy Markdown

Related issue

Customers integrating OpenShift External DNS Operator with Infoblox need two external-dns flags that were not exposed through the ExternalDNS CR:

  • --interval — controls how often external-dns synchronizes DNS records
  • --infoblox-max-results — sets the maximum number of DNS records Infoblox returns per request

Without these, operator-managed deployments only received a fixed set of hardcoded args. Manual Deployment patches were reverted on reconcile because the operator owns container args.

This PR exposes both settings declaratively via the ExternalDNS CR and wires them through the operator deployment builder.

New CR fields

CR field external-dns flag Scope
spec.intervalSeconds --interval All providers
spec.provider.infoblox.maxResults --infoblox-max-results Infoblox only

Both fields are optional (v1beta1 only). When unset/0, the operator omits the corresponding flag and external-dns keeps its own defaults. CRD validation: intervalSeconds min 60 / max 3600; maxResults min 0 / max 10000 (no CRD defaults).

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The API and CRD schemas add bounded intervalSeconds and Infoblox maxResults fields. The controller converts these fields into operand command-line arguments. Samples, documentation, and bundle manifests include the settings. Deployment tests verify generated arguments. An end-to-end test verifies the interval argument and sync timing.

Suggested reviewers: grzpiotrowski, alebedev87


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Ote Binary Stdout Contract ❌ Error test/e2e/operator_test.go writes with fmt.Printf in TestMain (lines 74–109), which emits non-JSON stdout; no stderr redirection is configured. Change all TestMain status and error writes to fmt.Fprintf(os.Stderr, ...) or configure logging to stderr before any output.
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.
✅ Passed checks (13 passed)
Check name Status Explanation
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 Changed tests use static Go test names and the table case is a fixed descriptive string; no Ginkgo titles or dynamic pod, timestamp, namespace, node, IP, or UUID values appear in titles.
Test Structure And Quality ✅ Passed The PR adds standard Go tests, not Ginkgo It blocks; the e2e test uses deferred cleanup, bounded PollUntilContextTimeout waits, and diagnostic failure messages.
Microshift Test Compatibility ✅ Passed The new e2e test is a standard Go test, not Ginkgo, and uses only ExternalDNS, Deployments, Pods, Secrets, and core Kubernetes APIs; no unsupported MicroShift API, namespace, or assumption is added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added TestExternalDNSSyncInterval uses one Deployment and one running pod, then reads logs; it has no node-count, scheduling, affinity, failover, drain, or multi-endpoint assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The commit adds CR fields, external-dns container arguments, and tests only; it adds no affinity, topology spread, replica, PDB, node-selector, or broad toleration scheduling constraint.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The added test is a standard Go testing.T test, not a Ginkgo test, and its body uses only cluster API/pod logs with no IPv4 literals or external URLs.
No-Weak-Crypto ✅ Passed The patch adds configuration, argument wiring, and tests only; added lines contain no MD5, SHA-1, DES, RC4, Blowfish, or ECB use, crypto APIs, or secret/token comparisons.
Container-Privileges ✅ Passed The PR adds no unsafe privilege settings. Manifest search found no true privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation values; pod contexts enforce non-root execu...
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no production logging. The new e2e test parses pod logs without emitting raw lines; its logs contain only resource names, errors, timestamps, and interval values.
Title check ✅ Passed The title clearly summarizes the two main changes: adding the ExternalDNS interval and Infoblox maxResults settings.
Description check ✅ Passed The description directly explains the new CR fields, external-dns flags, validation limits, and operator behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 1, 2026
@openshift-ci

openshift-ci Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Hi @sanjaytripathi97. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/usage.md (1)

213-214: 💤 Low value

Consider clarifying that interval applies to all providers.

The interval field is provider-agnostic and can be used with AWS, GCP, Azure, BlueCat, and Infoblox. Currently it's only documented in the Infoblox example, which may give the impression it's Infoblox-specific. Consider adding a brief note such as "optional, applies to all providers" or showing it in another provider example.

🤖 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 `@docs/usage.md` around lines 213 - 214, Clarify that the interval field is
provider-agnostic by updating the docs: add a short note next to the existing
"interval: 5m" line (or in a shared config section) stating "optional, applies
to all providers (AWS, GCP, Azure, BlueCat, Infoblox)" and/or show the same
interval comment in at least one other provider example so readers don't assume
it's Infoblox-specific; update the text around the example to reference the
global nature of the interval setting and ensure the symbol "interval" and
provider names AWS, GCP, Azure, BlueCat, Infoblox are mentioned.
🤖 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.

Nitpick comments:
In `@docs/usage.md`:
- Around line 213-214: Clarify that the interval field is provider-agnostic by
updating the docs: add a short note next to the existing "interval: 5m" line (or
in a shared config section) stating "optional, applies to all providers (AWS,
GCP, Azure, BlueCat, Infoblox)" and/or show the same interval comment in at
least one other provider example so readers don't assume it's Infoblox-specific;
update the text around the example to reference the global nature of the
interval setting and ensure the symbol "interval" and provider names AWS, GCP,
Azure, BlueCat, Infoblox are mentioned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 2b2c06bf-7b29-4061-b5b4-9062bd77b002

📥 Commits

Reviewing files that changed from the base of the PR and between f97b82d and 8d02f77.

⛔ Files ignored due to path filters (2)
  • api/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • api/v1beta1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (8)
  • api/v1alpha1/externaldns_types.go
  • api/v1beta1/externaldns_types.go
  • api/v1beta1/externaldns_webhook.go
  • config/crd/bases/externaldns.olm.openshift.io_externaldnses.yaml
  • config/samples/infoblox/operator_v1beta1_infoblox_openshift.yaml
  • docs/usage.md
  • pkg/operator/controller/externaldns/pod.go
  • pkg/operator/controller/externaldns/pod_interval_test.go

@theiratenate

Copy link
Copy Markdown

@alebedev87 @grzpiotrowski Please review when you can. We have some developers looking to use CNAME records in our root domain and need the max results added to resolve their plight.

@alebedev87

Copy link
Copy Markdown
Contributor

@theiratenate, @sanjaytripathi97 : https://redhat.atlassian.net/browse/RFE-6781 is not accepted yet. But I think it would be easier to do so if the PR will be in a ready state. Let me have a look.

Comment thread api/v1alpha1/externaldns_types.go
Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread api/v1beta1/externaldns_webhook.go Outdated
Comment thread pkg/operator/controller/externaldns/pod_interval_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@test/e2e/infoblox_sync_options_test.go`:
- Around line 81-94: The code at the end of the container validation loop
returns true, nil unconditionally at line 94, even if no external-dns container
was found and validated. To prevent false-positive test passes, introduce a
boolean flag before the loop to track whether an external-dns container was
found. Set this flag to true after successfully validating a container that has
a name starting with "external-dns" and contains both the intervalArg and
maxResultsArg arguments. At the end of the function, check this flag and return
false if no matching external-dns container was ever found and validated,
ensuring the test fails when expected containers are missing.
- Around line 57-59: The defer cleanup block in the test is ignoring the error
returned from common.KubeClient.Delete(context.TODO(), &extDNS) by using the
underscore operator, which violates the coding guideline of never ignoring error
returns and can hide leaked Custom Resources. Replace the underscore with a
proper error variable and handle the error appropriately by either logging it or
asserting that the deletion should succeed, rather than discarding the error.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 914281a1-313e-4627-bee0-d63885c658f7

📥 Commits

Reviewing files that changed from the base of the PR and between 8d02f77 and fc8963e.

⛔ Files ignored due to path filters (1)
  • api/v1beta1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
📒 Files selected for processing (6)
  • api/v1beta1/externaldns_types.go
  • config/crd/bases/externaldns.olm.openshift.io_externaldnses.yaml
  • pkg/operator/controller/externaldns/pod.go
  • pkg/operator/controller/externaldns/pod_interval_test.go
  • test/e2e/infoblox.go
  • test/e2e/infoblox_sync_options_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/operator/controller/externaldns/pod.go
  • pkg/operator/controller/externaldns/pod_interval_test.go
  • config/crd/bases/externaldns.olm.openshift.io_externaldnses.yaml

Comment thread test/e2e/infoblox_sync_options_test.go Outdated
Comment thread test/e2e/infoblox_sync_options_test.go Outdated
@sanjaytripathi97
sanjaytripathi97 force-pushed the add-infoblox-max-results-and-interval branch from fc8963e to ecd0951 Compare June 22, 2026 09:18

@alebedev87 alebedev87 left a comment

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.

Thanks a lot for the follow-up! I think we are closer to the good implementation. I re-reviewed the OpenShift API conventions meanwhile and had to reconsider the defaulting strategy PTAL.

Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread pkg/operator/controller/externaldns/pod_interval_test.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@test/e2e/infoblox_sync_options_test.go`:
- Line 194: Update the resource cleanup around readCloser in the
timestamp-parsing flow so its Close error is propagated when parsing otherwise
succeeds. Preserve any existing timestamp parsing error as the returned error,
and ensure the defer no longer discards readCloser.Close()’s result.
- Around line 102-108: Update the failure logging in the container argument
checks within the e2e test to omit the full container.Args list, which may
expose internal hostnames. Keep logging the container name and the missing
expected flag (intervalArg or maxResultsArg) only, while preserving the existing
failure returns.
- Around line 49-53: Register cleanup for the independently created credentials
Secret in the test immediately after the successful common.KubeClient.Create
call, using the test cleanup mechanism to delete credSecret and prevent stale
resources or name collisions. Keep the existing creation failure handling
unchanged.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d887fcc-ceb1-45d6-9ea5-a21b73640b5d

📥 Commits

Reviewing files that changed from the base of the PR and between fc8963e and 2da7130.

📒 Files selected for processing (8)
  • api/v1beta1/externaldns_types.go
  • config/crd/bases/externaldns.olm.openshift.io_externaldnses.yaml
  • config/samples/infoblox/operator_v1beta1_infoblox_openshift.yaml
  • docs/usage.md
  • pkg/operator/controller/externaldns/pod.go
  • pkg/operator/controller/externaldns/pod_interval_test.go
  • test/e2e/infoblox.go
  • test/e2e/infoblox_sync_options_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • config/samples/infoblox/operator_v1beta1_infoblox_openshift.yaml
  • docs/usage.md
  • test/e2e/infoblox.go
  • pkg/operator/controller/externaldns/pod.go

Comment thread test/e2e/infoblox_sync_options_test.go Outdated
Comment thread test/e2e/infoblox_sync_options_test.go Outdated
Comment thread test/e2e/infoblox_sync_options_test.go Outdated
if err != nil {
return nil, err
}
defer readCloser.Close()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle the stream close error.

Line 194 discards Close()’s error. Propagate it when timestamp parsing otherwise succeeds.

As per path instructions, **/*.go: “Never ignore error returns”.

🤖 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 `@test/e2e/infoblox_sync_options_test.go` at line 194, Update the resource
cleanup around readCloser in the timestamp-parsing flow so its Close error is
propagated when parsing otherwise succeeds. Preserve any existing timestamp
parsing error as the returned error, and ensure the defer no longer discards
readCloser.Close()’s result.

Source: Path instructions

@alebedev87

Copy link
Copy Markdown
Contributor

I just checked out and found that https://redhat.atlassian.net/browse/RFE-8890 and https://redhat.atlassian.net/browse/RFE-8888 got approved in April. This PR addresses both of these RFEs. Let's reference them in the description.

@alebedev87

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 28, 2026

@alebedev87 alebedev87 left a comment

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.

Another review with a deeper look into unit and e2e tests.

Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread api/v1beta1/externaldns_types.go Outdated
Comment thread config/crd/bases/externaldns.olm.openshift.io_externaldnses.yaml
Comment thread pkg/operator/controller/externaldns/pod_interval_test.go Outdated
Comment thread test/e2e/infoblox_sync_options_test.go Outdated
Comment thread test/e2e/infoblox_sync_options_test.go Outdated

@alebedev87 alebedev87 left a comment

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.

The API LGTM, some remarks about the e2e test though.

Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Comment thread test/common/common.go Outdated

@alebedev87 alebedev87 left a comment

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.

2 last finishing touches, the rest LGTM. Let's fix them and get the CI green. And one more thing: commits - let's fix them up into a single one with a good description, thanks!

Comment thread test/e2e/operator_test.go Outdated
Comment thread test/e2e/operator_test.go Outdated
Expose sync interval and Infoblox WAPI max results through the
ExternalDNS API so operator-managed deployments can configure
--interval and --infoblox-max-results without manual Deployment patches.

intervalSeconds is provider-agnostic (int32, min 60 / max 3600) with no
CRD default; when unset the operator omits --interval and external-dns
keeps its own default. maxResults is Infoblox-only (min 0 / max 10000)
and is omitted when unset/0.

Includes unit coverage in TestDesiredExternalDNSDeployment, a
provider-agnostic e2e that verifies real sync spacing from operand
logs, and regenerated CRD/bundle manifests.
@sanjaytripathi97
sanjaytripathi97 force-pushed the add-infoblox-max-results-and-interval branch from 13f0516 to c2dd31b Compare July 31, 2026 05:34
@alebedev87

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@sanjaytripathi97: 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.

@alebedev87

Copy link
Copy Markdown
Contributor

All CI is green.

/approve
/lgtm

Holding to let NI&D team have a look.
/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 31, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2026
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87

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:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants