Skip to content

OCPBUGS-77012: Wait for dns to be propgated#508

Open
gnufied wants to merge 1 commit intoopenshift:mainfrom
gnufied:wait-for-dns-efs
Open

OCPBUGS-77012: Wait for dns to be propgated#508
gnufied wants to merge 1 commit intoopenshift:mainfrom
gnufied:wait-for-dns-efs

Conversation

@gnufied
Copy link
Member

@gnufied gnufied commented Feb 17, 2026

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

@gnufied: This pull request references Jira Issue OCPBUGS-77012, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Fixes https://issues.redhat.com/browse/OCPBUGS-77012

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-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Feb 17, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

Walkthrough

Added DNS propagation wait functionality to EFS volume creation. Introduced net import, DNS-related constants (dnsCheckDelay, dnsCheckFactor, dnsCheckSteps, efsDNSFormat), and waitForDNSPropagation method using exponential backoff DNS lookups. CreateEFSVolume now invokes this method after mounting targets.

Changes

Cohort / File(s) Summary
EFS DNS Propagation
pkg/efscreate/efs.go
Added DNS propagation wait mechanism with net package import, DNS-related constants for exponential backoff configuration, and waitForDNSPropagation helper method that performs region-based DNS resolution with retry logic and status logging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

@openshift-ci openshift-ci bot requested review from dobsonj and mpatlasov February 17, 2026 20:14
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied

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 Feb 17, 2026
Copy link

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/efscreate/efs.go`:
- Around line 276-278: In waitForDNSPropagation, avoid dereferencing nil
PlatformStatus/AWS by first checking efs.infra.Status.PlatformStatus and
efs.infra.Status.PlatformStatus.AWS for nil before accessing Region; if either
is nil return a descriptive error (or wrap/contextualize the error) so callers
know the cluster/platform info is missing instead of panicking; update
references in waitForDNSPropagation to use the validated values
(efs.infra.Status.PlatformStatus and .AWS) when building dnsName.

Comment on lines +276 to +278
func (efs *EFS) waitForDNSPropagation(ctx context.Context) error {
region := efs.infra.Status.PlatformStatus.AWS.Region
dnsName := fmt.Sprintf(efsDNSFormat, efs.resources.efsID, region)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -n -C3 'PlatformStatus\.AWS\.Region'

Repository: openshift/csi-operator

Length of output: 4872


🏁 Script executed:

# Get the full waitForDNSPropagation function
sed -n '276,310p' pkg/efscreate/efs.go

# Get more context - where this function is called
rg -n 'waitForDNSPropagation' pkg/efscreate/

# Check the create.go usage at line 51 for comparison
sed -n '40,60p' pkg/efscreate/create.go

Repository: openshift/csi-operator

Length of output: 2286


🏁 Script executed:

# Find the getInfra function definition
rg -n 'func getInfra' pkg/efscreate/

# Check the function implementation
sed -n '1,100p' pkg/efscreate/create.go | grep -A 30 'func getInfra'

Repository: openshift/csi-operator

Length of output: 863


🏁 Script executed:

# Check if there's an early return or check for AWS platform in create.go
head -n 60 pkg/efscreate/create.go

# Check where NewEFSSession is called and if there's any guard
rg -n -B5 'NewEFSSession' pkg/efscreate/

Repository: openshift/csi-operator

Length of output: 2769


Add nil check before accessing PlatformStatus.AWS.

Line 277 directly accesses efs.infra.Status.PlatformStatus.AWS.Region without validating that PlatformStatus or AWS is non-nil. While this code runs only on AWS clusters, other parts of the codebase defensively check for nil values before accessing these fields (e.g., aws_efs_tags_queue_worker.go:45). Add a nil check to prevent potential panics from misconfiguration or unexpected call contexts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/efscreate/efs.go` around lines 276 - 278, In waitForDNSPropagation, avoid
dereferencing nil PlatformStatus/AWS by first checking
efs.infra.Status.PlatformStatus and efs.infra.Status.PlatformStatus.AWS for nil
before accessing Region; if either is nil return a descriptive error (or
wrap/contextualize the error) so callers know the cluster/platform info is
missing instead of panicking; update references in waitForDNSPropagation to use
the validated values (efs.infra.Status.PlatformStatus and .AWS) when building
dnsName.

@gnufied
Copy link
Member Author

gnufied commented Feb 18, 2026

/retest

1 similar comment
@gnufied
Copy link
Member Author

gnufied commented Feb 26, 2026

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 26, 2026

@gnufied: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/aws-efs-operator-e2e f767085 link true /test aws-efs-operator-e2e
ci/prow/verify f767085 link true /test verify

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.

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. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants