OCPBUGS-77012: Wait for dns to be propgated#508
OCPBUGS-77012: Wait for dns to be propgated#508gnufied wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@gnufied: This pull request references Jira Issue OCPBUGS-77012, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this: 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. |
WalkthroughAdded 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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.
| func (efs *EFS) waitForDNSPropagation(ctx context.Context) error { | ||
| region := efs.infra.Status.PlatformStatus.AWS.Region | ||
| dnsName := fmt.Sprintf(efsDNSFormat, efs.resources.efsID, region) |
There was a problem hiding this comment.
🧩 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.goRepository: 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.
|
/retest |
1 similar comment
|
/retest |
|
@gnufied: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Fixes https://issues.redhat.com/browse/OCPBUGS-77012